Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello ,

I want to highlight the nodes of the treeview whose values is saved in the database.
Can anyone suggest how can achieve my goal.

Thanks
Deepak
Posted
Comments
BillWoodruff 20-Feb-12 1:00am    
Does that mean that your Database has one row (or whatever) per TreeNode, and that those TreeNodes may, at any one point in time: have no value (null): have some default value: have a current value which does not match the value shown in the TreeView ?

Since you imply some Nodes' values may not be saved (and so those Nodes should not be high-lighted), I assume you are describing a situation where there is no databinding between database treeview, correct ?

If so, please tell us how you now update the database when a TreeNode's content has been changed ... and so the Treeview and Database are out-of-synch.

Can we assume the Database itself is not being changed by anything but the TreeView content being edited ?

1 solution

1.Select selected value from database
2.Compare the selected value with the treeview node value 
3.If database selected value same as treeview node value then mark it selected or highlighted
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900