Reinitializing form values after removeAll() (C#) - InfoPath Dev
in

InfoPath Dev

Qdabra® DBXL

Use our Google Custom Search for best site search results.

Reinitializing form values after removeAll() (C#)

Last post 08-21-2007 12:19 AM by Shiva. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-09-2007 12:41 PM

    Reinitializing form values after removeAll() (C#)

    My form system will allow the user to submit several times, starting over with a clean form each time and not closing infopath.

     

    I'm using code to submit the form and am currently able to clear the form.  The problem is that all the fields are grayed out after I use 'removeAll' .

     

    The code to clean up all the values is:

    IXMLDOMSelection reset = (IXMLDOMSelection)thisXDocument.DOM.selectSingleNode("//my:new").selectNodes("*");
    reset.removeAll();

     

     

    How can I reinitialize these values after I clear them out?

     

    Thanks,

    -C 

  • 08-21-2007 12:19 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Reinitializing form values after removeAll() (C#)

    Hi,

    Here is the below code first deletes the all child nodes and next we are adding those nodes.

    IXMLDOMNode parentNode = thisXDocument.DOM.selectSingleNode("//my:new");

    IXMLDOMNodeList childNodes = thisXDocument.DOM.selectSingleNode("//my:new").selectNodes("*");

    IXMLDOMNodeList tempChildNodes = childNodes;

    childNodes.removeAll();

    foreach (IXMLDOMNode tempChildNode in tempChildNodes)
    {

    parentNode.appendChild(tempChildNode);

    }

    Hope this Helps you

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