For example, there are .Name, .Text fields. What if I need Type, Path and Direction fields, how can I add them to class TreeNode ?
For example, there are .Name , .Text fields. What if I need Type ,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Does this satisfy what you intended? I’ve shown these as properties, but omit the {get;set;} and you’ll have fields.
To add myTreeNode instances to a TreeView, you’d do this:
If you want to use the Tag property instead of storing these directly in an inherited node, (showing just two properties instead of 3)
Then, in your code that creates the tree, you’ll do this: