If we foreach a object elements in loop, I want to add or delete before, or after some elements. How I can I do at the loop foreach. Please help.
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
Use for loop instead of foreach and use index to access the Items like:
because if you delete an item from ForEach it will give an exception, since the collection is changed now! |
|||||||||
|