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.
Unfortunately, activation email could not send to your email. Please try again.

TreeView. How to store information in Tree Nodes

Thread ID:

Created:

Updated:

Platform:

Replies:

14569 May 28,2004 11:30 PM May 29,2004 05:13 PM Windows Forms 1
loading
Tags: Tools
Luis Guerra
Asked On May 28, 2004 11:30 PM

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

Steve Graddy
Replied On May 29, 2004 05:13 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;