We help IT Professionals succeed at work.

Automatically Expand Treeview After Refresh

433 Views
Last Modified: 2013-11-26
Hello,

I have a basic treeview which I would like the user to have the ability to add nodes to in real time.  Currently they define the nodes on one screen and when they close it, the treeview refreshes.  However, I would like to appear to the user as if the node was placed there in real time.  The problem is that when I refresh the treeview, all of their expanded nodes disappear.

Does anyone have a quick and easy way to store which nodes are expanded and then re-expand them (taking into account that there will now be one extra node)?

Thanks,
-Torrwin
Comment
Watch Question

Jaime OlivaresSoftware Architect
CERTIFIED EXPERT
Top Expert 2008

Commented:
>>Currently they define the nodes on one screen and when they close it, the treeview refreshes.
That means you fill the tree again?
If so, why to fill instead of adding the new node?
Jorge PaulinoIT Pro/Developer
CERTIFIED EXPERT
Top Expert 2008

Commented:
This is WinForms or ASP.NET ?

Author

Commented:
This is a windows application, and they could also have edited the data or deleted records.
Software Architect
CERTIFIED EXPERT
Top Expert 2008
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Jaime OlivaresSoftware Architect
CERTIFIED EXPERT
Top Expert 2008

Commented:
Sorry, I have provided a C# solution, please tell me if you need the translation to vb.net
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.