How to get Infopath Controls into Visual studio work envorment. - InfoPath Dev
in

InfoPath Dev

How to get Infopath Controls into Visual studio work envorment.

Last post 08-09-2010 06:21 AM by Qazi Anis. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-09-2010 03:03 AM

    How to get Infopath Controls into Visual studio work envorment.

    Hello,

    I have created one form in infopath 2007. I open this form into Microsoft Visual Studio Tool for coding. But i am not able to access my infopath form controls
    like txtName, ddlDepartment into visual environment please help me how can i get those controls into VB.

    I am totally new to infopath form so please help on this.

    Thank you.

    Bhavin A Sankhat
    Filed under:
  • 08-09-2010 06:15 AM In reply to

    Re: How to get Infopath Controls into Visual studio work envorment.

     I find the way to access the InfoPath Controls in C#

     

    Code to read Form field data using c#:


    XPathNavigator elemYourTextBox = this.MainDataSource.CreateNavigator()
                        .SelectSingleNode("//my:YourTextBox", this.NamespaceManager);

    String DataFromTextField = elemYourTextBox.Value;


    -----------------------------------------------------------------

    Code to set Form field data using c#:

    XPathNavigator elemYourTextBox = this.MainDataSource.CreateNavigator()
                        .SelectSingleNode("//my:YourTextBox", this.NamespaceManager);

    elemYourTextBox.SetValue("Your String Data");

     

    Bhavin A Sankhat
    Filed under:
  • 08-09-2010 06:21 AM In reply to

    Re: How to get Infopath Controls into Visual studio work envorment.

     an easier way

     XPathNavigator xnod = this.MainDataSource.CreateNavigator();

    XPathNavigator xnele = xndoc.SelectSingleNode("xpath of element", this.NamespaceManager);

    Qazi Anis
    Technical Architect
    Bitwise Inc
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.