We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TreeView. How to store information in Tree Nodes

Is there a way to store some information (nodeId,nodeindex,etc)in tree nodes besides the text porperty. It would be nice if you can store an object in some property of the node like Tag

1 Reply

SG Steve Graddy May 29, 2004 09:13 PM UTC

You can store any object you would like in the node Tag property. All you have to do is cast to the proper object when you access it. Example C# : CustomObject custObj = (CustomObject)treeView.Node.Tag; string something = custObj.SomeStringProperty; That is as easy as it gets.... >Is there a way to store some information (nodeId,nodeindex,etc)in tree nodes besides the text porperty. >It would be nice if you can store an object in some property of the node like Tag

Loader.
Up arrow icon