Hi,
You can restrict the number rows in a repeating table using the following code in C#.
public void group6_Changing(object sender, XmlChangingEventArgs e)
{
XPathNavigator xn = this.MainDataSource.CreateNavigator(); XmlNamespaceManager xnsm = new XmlNamespaceManager(new NameTable()); xnsm.AddNamespace("my", "<Name space of the form>");
XPathNodeIterator nodeIterator = xn.Select("/my:myFields/my:group5/my:group6", xnsm);
int count = 2;
if(nodeIterator.Count > count)
{
e.CancelableArgs.Cancel = true;
return;
}
}
Here "/my:myFields/my:group5/my:group6" is the repeating table xpath. and
Count is the number of rows you want to restrict after.
Note: After this it will show a error message.