I have an application where I am populating treeview controls with data indicating whether nodes have been checked previously by the user. When loading the control I would like to expand nodes that are already checked. Is there a property or method that I can use to do that? Thanks in advance for any assistance.
10-14-2010, 09:55 PM
There is a Tag property on all the controls, including the TreeNode, that you can use for whatever you want. Simply use it as a flag.
While you are loading the treeview with your data, put True in that property for the nodes that have been checked previously.
Once all the data is there, loop through the nodes and Expand those that have True in their Tag property.