I have this table structure:
– CategoryID
– CategoryName
– ParentID
I want to load data from this table into a treeview control, to be able to edit/delete these records. How to do that?
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.
For more details see: How do you databind to a TreeView control? (the question is WinForms, but still applies to ASP.NET)
The long and short is that you can’t databind to a TreeView. TreeViews are hierarchical data structures and as such do not have a native binding mechanism. You’ll have to roll your own binding to do this.