Insert new row in a repeating table

C

carlos.ht

Hi All,

Is there anyway I can insert a new row in a repeating table with two
controls using a button ?


Regards,

Carlos
 
Z

Zhang Haiguang

Please try the following codes in InfoPath 2007:
public void CTRL6_5_Clicked(object sender, ClickedEventArgs e)
{
// Write your code here.
XPathNavigator ContextNode =
this.MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group1/my:group2",
NamespaceManager);
this.CurrentView.SelectNodes(ContextNode);
this.CurrentView.ExecuteAction(ActionType.XCollectionInsert,
"group2_1");
}

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

Justin Greywolf

Zhang - in the following statement from the sample code below

this.CurrentView.ExecuteAction(ActionType.XCollectionInsert, "group2_1");

What does the value "group2_1" actually mean? Ie, if this code is run every
time the button is clicked, do you just need to add the repeating table name
(in this case, lets say it is "group2") followed with the "_1" value? Or
will something else need to be added?

This is quite confusing to me, ad I have not been able to find any good
informaiton to really explain this over the past couple of weeks.

Thanks!

Justin
 

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