InfoPath Using C#

V

vb6dev2003

Where can I find real samples and/or references about IP using VS.Net with
C#? Most samples I see have js files.
There are 10 samples in the SDK. Only 2 of them feature C# code, but for
the Web Service layer, not the form.

I have a form with JS that I want to convert to C#. How do I do basic stuff
such as Switching Views, Set xml node values by code?

Thanks

vbdev
 
M

Michelle

I can't really point you to any samples/references using C#, BUT can
give an example of how to do the two things you asked for.

To set xml nodes by code:
thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1").text =
"new value";

To switch views:
thisXDocument.View.SwitchView("View Name");

Also, to set a view as a default view (where 0 is the index of the
view):
thisXDocument.ViewInfos[0].IsDefault = true;

Hope this helps a little.
Michelle
 
V

vb6dev2003

Hi Greg,

I am having trouble in general:
Where can I find C# sample (the code with the VS solution) that would
illustrate how to use OnLoad to pre-populate fields, SwitchViews, etc.

vbdev

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
Are you having trouble converting particular lines of code, or just
conversion troubles in general?

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Where can I find real samples and/or references about IP using VS.Net with
C#? Most samples I see have js files.
There are 10 samples in the SDK. Only 2 of them feature C# code, but for
the Web Service layer, not the form.

I have a form with JS that I want to convert to C#. How do I do basic stuff
such as Switching Views, Set xml node values by code?

Thanks

vbdev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top