How to add new row in Repeating Table.

D

dsen.25

Hi,
I am using following code to add new
row in repeating table.

IXMLDOMNode Item1 = thisXDocument.DOM.selectSingleNode("my:myFields/
my:group6/my:group7/my:txtItem1");

Item1.text="";

IXMLDOMNode Desc1 = thisXDocument.DOM.selectSingleNode("my:myFields/
my:group6/my:group7/my:txtDesc1");

Desc1.text="";

IXMLDOMNode CreatedDt1 =
thisXDocument.DOM.selectSingleNode("my:myFields/my:group6/my:group7/
my:txtCreatedDt1");

CreatedDt1.text=dtServer.ToString();

IXMLDOMNode Planed1 = thisXDocument.DOM.selectSingleNode("my:myFields/
my:group6/my:group7/my:dtPlaned1");
Planed1.text="";

IXMLDOMNode Status1 = thisXDocument.DOM.selectSingleNode("my:myFields/
my:group6/my:group7/my:cboStatus1");
Status1.text="";

IXMLDOMNode ClosureDt1 =
thisXDocument.DOM.selectSingleNode("my:myFields/my:group6/my:group7/
my:dtClosureDt1");

ClosureDt1.text="";

IXMLDOMNode ClComments1 =
thisXDocument.DOM.selectSingleNode("my:myFields/my:group6/my:group7/
my:txtClComments1");

ClComments1.text="";


thisXDocument.View.ExecuteAction("xCollection::insert","group7_61");

But i got following error:

System.NullReferenceException
Object reference not set to an instance of an object.
at CustomerFeedBack.CustomerFeedBack.OnLoad(DocReturnEvent e) in e:
\projects\new cust feedback\customerfeedback\formcode.cs:line 620
at
Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent
pEvent)

How to add new row in repeating table.
Please Help me.Its very urgent.

Thanks,
Senthil Kumar D
 
Z

Zhang Haiguang

Maybe thisXDocument.View.ExecuteAction cannot be called during onLoad,
please try to add the new row element on DOM directly.

InfoJet Service, a product likes InfoPath Form Services,
http://www.infojetsoft.com
 

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