How to display values in infopath

A

Arthur Pendragon

Hi all,

I'm using InfoPath 2007 and I'm very new at it. I'm not sure how to do
this so I'm asking you guys.

I want to display a simple text ("Text") to a textbox in my form. The
textbox's ID is userName. I don't know the syntax that I should use to
display the text in the textbox. If in VB .NET it is 'TextboxName.Text
= "Text" ', what would it be in InfoPath?

I hope you could help me on this.

Thanks so much and more power.


Regards,
Arthur
 
S

Sudhir Kesharwani

if you are using Visual Studion Tools for Office (VSTO) then you can
write following code to access the xml node for your text box...

XPathNavigator root = this.MainDataSource.CreateNavigator();

Now access the property value using following statement.
root.SelectSingleNode("/my:myFields/
my:userName",this.NamespaceManager).Value) = "AnyValue";
 
K

K.Ramana Reddy

Hi,

First you need to get the textbox reference using xpath. see below.
string name = XDocument.DOM.selectSingleNode("Xpath of your textbox")

then
name.text="enter text"
or

XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text="enter text"

I hope this will help for you.
 
Top