Clear all fields(data source) on InfoPath Form(2007).

J

Joseph

I have a form and there are textboxes and dropdownlists on them. When i click
Clear Form Button, i want to delete all values on them. Thanks...
InfoPath 2007
 
K

K.Ramana Reddy(GGK Tech)

Hi,

First get the all nodes you want clear the values and replace nodes with
sampledata.xml.
(Sampledata.xml has the empty nodes always)

I hope this will help for you.
 
S

Shiva, GGK Tech

Hi,

Using below the code you can clear your data.

//First get the node which you want clear the node
IXMLDOMNode childNode = thisXDocument.DOM.selectSingleNode(“XPath of your
child nodeâ€);
//Get the parent node.
IXMLDOMNode parentNode = thisXDocument.DOM.selectSingleNode(“XPath of your
parent nodeâ€);
//Get the child node from sample dom.
IXMLDOMNode childNodeFromSampleData = sampleDataDOM.selectSingleNode(“XPath
of your child nodeâ€);
//Replace sample data node with child node
parentNode.replaceChild(childNodeFromSampleData, childNode);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top