Getting data from controls during onLoad event - InfoPath Dev
in

InfoPath Dev

Getting data from controls during onLoad event

Last post 05-27-2008 02:41 AM by adamrharding. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-24-2008 07:35 AM

    • fused
    • Not Ranked
    • Joined on 05-24-2008
    • Posts 1

    Getting data from controls during onLoad event

     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.
     

  • 05-27-2008 02:41 AM In reply to

    Re: Getting data from controls during onLoad event

    Hi fused

    First off, welcome to the forum.

    Two thoughts but does the same happen when you are connected to a datasource? 

    I run conditional events throught rules on form load and that works fine to do things like switch views etc.  I do not see why custom onLoad would be any dirfferent.  Maybe try creating the rule on load and see how it performs to get some clue as to how the code part would work.

    I hope this helps

    Adam

    Adam Harding
    Wales
    UK
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.