I am working on a project that uses a treeview that has three levels. Each level is coming from a different table in my database. It is being populated at run time by looping through 3 datatables. Everything works fine. Just for some background this is what it might look like.
-John Doe
+Jane Doe
When you click on a specific item in the tree different forms (in the form of user controls) appear on the right side of my main form. I want to be able to make changes to say Customer Name (John Doe) on the right that update the database and then have the tree re-populated. I am not having any problems here.
What I am having trouble doing is having the tree reload in the exact way it was left. Meaning whatever nodes where expanded will be expanded and whatever nodes were collapsed will be collapsed. Most importantly, I want the node that was selected the first time around to be selected after the tree is re-loaded.
Has anyone have a solution to this?
What if I add a customer? Can I have the tree reload and automatically have it selected?
-John Doe
-Job 23423
+Job 65656
+Bob SmithCustomer 12
Customer 23
Customer 46
Customer 87
+Job 53533Customer 23
Customer 46
Customer 87
+Job 65656
+Jane Doe
When you click on a specific item in the tree different forms (in the form of user controls) appear on the right side of my main form. I want to be able to make changes to say Customer Name (John Doe) on the right that update the database and then have the tree re-populated. I am not having any problems here.
What I am having trouble doing is having the tree reload in the exact way it was left. Meaning whatever nodes where expanded will be expanded and whatever nodes were collapsed will be collapsed. Most importantly, I want the node that was selected the first time around to be selected after the tree is re-loaded.
Has anyone have a solution to this?
What if I add a customer? Can I have the tree reload and automatically have it selected?
Last edited: