This is a migrated thread and some comments may be shown as answers.

sql Hierarchical not showing using Linq

2 Answers 106 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 11 Jan 2008, 06:04 AM
Hi,

If I used the Linq method, like the following codes, the parent nodes will be ignored. It will only work if i use the conventional dataset or datatable connection.

Did i miss out anything or this is the practice?

var TreeViewSource = from TreeData in dcBIDB.TblTreeDirectories select TreeData;

RadTreeView1.DataTextField = "Title";
RadTreeView1.DataFieldID = "CategoryId";
RadTreeView1.DataFieldParentID = "ParentId";
RadTreeView1.DataSource = TreeViewSource;
RadTreeView1.DataBind();

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 11 Jan 2008, 07:43 AM
Hi David,

Hierarchical databinding (by setting DataFieldID/DataFieldParentID) works when binding to DataTable, DataView or DataSet. Other datasources need to implement the IHierarchicalEnumerable interface at least.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ed
Top achievements
Rank 1
answered on 03 Jul 2008, 01:52 AM
Hi,

I just spent my first afternoon with these controls and the very first thing I run into was this issue.

Any plans on providing a solution for this? I could have used one today.

Cheers,
Ed.
Tags
TreeView
Asked by
David
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Ed
Top achievements
Rank 1
Share this question
or