
Hello,
I have copied some of your example about Hierarchical Data Binding but for some reason my copy is not producing a herarchical view, all of the items are bound to the same menu level.
Code:
TreeView1.DataValueField = "Id";
TreeView1.DataTextField = "Name";
TreeView1.DataFieldParentID = "ParentId";
TreeView1.DataSource = ModelManager.Provider.GetMembersBookmarks(5148);
TreeView1.DataBind();
Data:
Id, Name, ParentId
1 Bookmarks 0
2 folder 1
3 test 2
I hope that you can help me.
Many thanks
Richard Priddy
7 Answers, 1 is accepted
ParentID of the root Nodes should be NULL in the database as a requirement for the Hierarchical Data Binding to work correctly.
This is also shown in this help article.
Best wishes,
Simon
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Hello,
I have switched that over to be null in my database, when copying the code from your example, where the SQL is written in the code everything seems to work fine.
I, however, am using a collection (Inherits from GenericCollectionBase) and am still getting the problem of non-hierachical displays.
Any thoughts would be appritiated.
Richard
RadTreeView supports hierarchical databinding only to IHierarchicalEnumerable/IHierarchicalDataSource and DataSet/DataTable/DataView (through setting the DataFieldID/DataFieldPerentID).
Just for your information, hierarchical databinding will be available with the next Service Pack of RadControl for ASP.NET AJAX.
Until then, I suggest you try out this Code Library Project.
Regards,
Simon
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Josh
Greetings,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Please excuse me for the inconvenience. My reply seems to have been sent prematurely. The ETA for this feature is the first service pack of the Q2 release which is due at the end of August. Should you need the bits earlier open a support ticket and we will send you the current unofficial build.
Greetings,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.