I'm trying to access the selection of a drop down list by using C# on the onLoad event of my Infopath form.
I wish I had code to show you but it's on my work computer and I am at home. I can give you the basics though.
I'm not sure if all of this is correct, but it's mainly the
selectSingleNode part that I am interested in. The syntax is correct
in my code at work.
I am using the selectSingleNode command like so:
XDocument.DOM.selectSingleNode("//my:dataSourceName").ToString();
What it is returning is string that has the text of some kind of Microsoft NodeWrapper.
I was thinking that nothing was selected, even though I set a default value on my drop down, so I tested this with a text box and got the exact same result.
Is there some problem with getting data from controls on the form on the onLoad event? I was thinking that maybe they are not yet loaded at this point, but that is just a guess.