Hi All,
I am currently using Infopath Listbox and populating its items from SharePoint list. I want to clear all the items in this list box on a button click. Could any one suggest me how to clear all the items. I am trying to iterate through the NamesGroup folder which is of repeating type. It has two fields Value and Display Name which are linked to my list box.
XPathNodeIterator xnNodeIterator = xnOneLevelBelow.Select("/my:myFields/my:NamesGroup", nsManager);
while(xnNodeIterator.MoveNext())
{
xnNodeIterator.Current.DeleteSelf();
if(xnNodeIterator.Current.HasChildren)
xnNodeIterator.Current.MoveToFirstChild();
}
I want to delete all the items in the list box. When I execute the code, it is giving me an error and the list box becomes unusable. I mean it does not allow me to add new items to it.
Any help would be helpful.
Thanks
Regards
Sridhar