Writing code behind using custom class instead of XPathNavigator - InfoPath Dev
in

InfoPath Dev

Writing code behind using custom class instead of XPathNavigator

Last post 06-08-2009 10:38 AM by jabcoco. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 06-08-2009 10:38 AM

    Writing code behind using custom class instead of XPathNavigator

    Hello, actually when i need to write code in a info path i create a visual studio projet for my info path form template then add handle to click button event and write my code in C# with XPathNavigator.

    I found that i can generate a "classes" base on a xds schema using the "xsd.exe" tools in a visual studio command prompt.
    That work fine, I've generate my classes using this tools, and now i have a "myclass.cs".

    But how can i initialize the "myclass" object, set value like i normally does with the XPathNavigator and then save it?

     

    Code sample:

    //Actual code
    XPathNavigator DOM = MainDataSource.CreateNavigator();
    DOM
    .SelectSingleNode("/my:myFields/@my:field1").SetValue("myval");
    this.Save(); //Built-in functionality, not override
     
    //What i'm trying to do.
    MyClass o = new MyClass(); //How to initialize with the actual content??
    o
    .field1 = "mynewvalue";
    //Now how can i save the new value?

     

    Filed under: ,
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.