Hi All, I have a TreeView control that contains one parent node, then a very large directory structure beneath that. I've been working on this from a couple different ways.
First, I load the directory structure, and compare it to another one, if the files (and directories) are different, I add the node to the treeview. Once the list is generated, I make a second sweep through the files that are checked (if I'm showing ALL files, not just differences) with a 3rd party file comparison tool. With the results of that (and I have verified), if the files are truly the same, then I do a node.Remove(). That's where the problem occurs; first I was doing a foreach on the nodes, then removing them if they aren't checked. When a node gets removed, the machine loses the "ID" or the NEXT node that it was supposed to check (it successfully removes the desired node, but skips the check for the next one and goes to the third). I tried bypassing this by using a for loop instead but get the same results.
Then, I decided to wait until all the way done with the comparisons to do the node removal, and still have the same problem, although not as severe (it only leaves one or two nodes that should have been removed.
Has anyone seen anything like this/know of a tip/trick to get around this?
Thanks,
First, I load the directory structure, and compare it to another one, if the files (and directories) are different, I add the node to the treeview. Once the list is generated, I make a second sweep through the files that are checked (if I'm showing ALL files, not just differences) with a 3rd party file comparison tool. With the results of that (and I have verified), if the files are truly the same, then I do a node.Remove(). That's where the problem occurs; first I was doing a foreach on the nodes, then removing them if they aren't checked. When a node gets removed, the machine loses the "ID" or the NEXT node that it was supposed to check (it successfully removes the desired node, but skips the check for the next one and goes to the third). I tried bypassing this by using a for loop instead but get the same results.
Then, I decided to wait until all the way done with the comparisons to do the node removal, and still have the same problem, although not as severe (it only leaves one or two nodes that should have been removed.
Has anyone seen anything like this/know of a tip/trick to get around this?
Thanks,