Accessing control properties using script

Y

Yonatann

Hi,
I've created some custom control using C#, i want on form load, via JScript,
to pass some data to my control.
However, i can not access any of my control propeties using the script:

var usersControl = XDocument.DOM.selectSingleNode("//my:field1");
usersControl.Value = "456";
or
usersControl.displayField = "33";

Altought those properties are com visible:
[ComVisible(true), Browsable(true)]
public string displayField...

It seems like the DOM.selectSingleNode returns the control's data from the
form's XML and not the control instance itself.

How can I interact with my custom control using script in the form? My main
goal is to pass data from web service to my contro.

Thanks.
 
G

Greg Collins

InfoPath does not work the same as HTML -- even though in the background it
is driven by HTML. You cannot programmtically change control properties--you
only change values and node existence.

For example, you can insert or delete nodes, or you can change their values.

Drop-down lists values that are manually entered cannot be controled via
code. However, if the drop-down is populated via some XML list then you can
certainly change the values of the source list, thus affecting the drop-down
list values.
 

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