By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,951 Members | 1,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,951 IT Pros & Developers. It's quick & easy.

Winforms 2.0 Treeview Control (refreshing source data)

P: 3

I have a Winforms 2.0 project that I'm working on that involves populating a treeview control from data contained in a fairly large dataset that has to be refreshed periodically.

I have no problems populating the treeview nodes initially, but am somewhat flustered as to how I should go about keeping the treeview control current with the dataset.

After the dataset has been refreshed, I can, of course, clear the treeview nodes and start building again, but that is not the desired solution as it blanks out the nodes and then builds them again, thus losing the state of all nodes in the treeview control (nodes that have been collapsed/expanded by the user); not to mention how disruptive this is to the visual experience.

What I would like to do is to add all new nodes to the treeview control and remove all of the obsolete nodes. It's simple enough to add the new nodes by first finding any nodes corresponding to data in the dataset, but how do I remove the nodes that are not in the dataset in a timely and efficient way?

How does everyone else do this?

Any suggestions would be greatly appreciated.


Aug 15 '07 #1
Share this Question
Share on Google+
1 Reply

P: 3
Anyone want to take a stab at this?
Aug 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.