Hi,
I am currently allowing our users to save the layout of their explorer bar (SaveAsXml method) but in doing so I've come across a problem when loading the data back into the explorer bar (LoadFromXml method).
The problem is if I delete one of the items in the explorer bar then load the layout of the explorer bar in, the deleted item comes back. Is there a way to check if the item has been deleted and not show it?
Thanks,Nathan.
You need to have some way of unambiguously identifying each item. One possible solution would be to use unique keys for all items (you could for example use Guid.NewGuid().ToString()), and then after loading the layout, check each item against a list that you maintain that contains the deleted items, and remove it if it is in the layout. The control exposes an ItemRemoved event which should make it easy to track the deleted items.
Another approach would be to handle ItemRemoved and save the layout again after the item is deleted.
Hi Brian,
Thank you for the suggestion. Since our project contains so many forms this wouldn't really be a feasible option.
I have written a simple layout saver that saves the only the important properties the client was actually using, i.e. group positions, groups expanded etc.