Hi,
I have a list bar which I have set to an explorer bar. I need to programmatically remove all the groups in the listbar and then reload the list bar with a different set of groups. I have 14 groups in my listbar and I tried a for next loop trying to remove each group and then a For Each Next loop to remove each group but every time my loop gets to 7 it crashes. I assume it counts down and the indexes change when I remove a group but I am thinking there has got to be an easier way. Any suggestions?
Thanks,Steve
Hi Steve,
You need to remove the groups in reverse order:
Group grp = null; for (int i = UltraWebListbar1.Groups.Count-1; i >= 0; i--) { grp = UltraWebListbar1.Groups[i]; UltraWebListbar1.Groups.Remove(grp); }
Thanks,
Valerie