XPathNodeIterator move.next method is not looping through each single value???
XPathNodeIterator move.next method is not looping through each single value???
(OP)
CODE --> C#
//update list item string siteUrl = http://sp-app/dev; ClientContext clientContext = new ClientContext(siteUrl); list oList = clientContext.Web.Lists.GetByTitle("Item Inventory"); PathNavigator root = MainDataSource.CreateNavigator(); XPathNodeIterator iter = root.Select("/my:myFields/my:group1", NamespaceManager); while (iter.MoveNext()) { string value = iter.Current.Value; int id; Int32.TryParse(value, out id); ListItem oListItem = oList.GetItemById(id); oListItem[ "Title"] = field1; oListItem.Update();
I figured out what is wrong but don't know how to fix it. When I select more than one checkboxes, the xPathNodeiterator concates all the values together instead of looping through each value individually. For instance,
select check box 1
select Checkbox 2
value = 12 my goal is to have a loop
value =1 than
value = 2.
select checkbox 1
value = 1
Can somone tell me why this isnt looping thorugh each single value? and why is it appending them all into one value? this will solve the problem. thanks
RE: XPathNodeIterator move.next method is not looping through each single value???
RE: XPathNodeIterator move.next method is not looping through each single value???
CODE -->
the error is on this line
ListItem oListItem = oList.GetItemById(value);--------{"The 'sId' argument is invalid."} The value is nothing.
RE: XPathNodeIterator move.next method is not looping through each single value???
RE: XPathNodeIterator move.next method is not looping through each single value???
, I get nothing for the value.
When I use this XPathNodeIterator iter = root.Select("/my:myFields/my:group1", NamespaceManager, i get the group of elements and therfore it concates all the values together and I thought the iter.move method would iterate each single value but it doesnt. I just do not know what the syntax or code is to select each single checkbox value and loop through each inidvidually.
RE: XPathNodeIterator move.next method is not looping through each single value???
RE: XPathNodeIterator move.next method is not looping through each single value???
CODE -->
RE: XPathNodeIterator move.next method is not looping through each single value???
if(value.Contains("1"))
// Process checkbox 1
if(value.Contains("2"))
// Process checkbox 2
RE: XPathNodeIterator move.next method is not looping through each single value???