Hi,
If I drag a treeview control onto my page and set the DataFieldParentID, I get the treeview correctly displaying with multi-levels of nodes/hierarchy.
However - if I try to create a treeView from my code like this:
The treeview just displays all the nodes at the same, top level - so there's there's no tree to it. It seems to be ignoring the ParentCategory field that I bound to the DataFieldParentID property.
Any ideas? And also - As this is a dynamically created control, I'm having trouble picking up the selected nodes. I'm adding the control at OnInit and Viewstate is enabled. Is there anything I need to do?
Thanks.
If I drag a treeview control onto my page and set the DataFieldParentID, I get the treeview correctly displaying with multi-levels of nodes/hierarchy.
However - if I try to create a treeView from my code like this:
| radTreeView.DataTextField = "CategoryName"; |
| radTreeView.DataValueField = "ID"; |
| radTreeView.DataFieldParentID = "ParentCategory"; |
| radTreeView.CheckBoxes = true; |
| radTreeView.DataSource = myDataSource; |
| radTreeView.DataBind(); |
| this.Controls.Add(radTreeView); |
Any ideas? And also - As this is a dynamically created control, I'm having trouble picking up the selected nodes. I'm adding the control at OnInit and Viewstate is enabled. Is there anything I need to do?
Thanks.