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

LINQ support for RadTreeView

7 Answers 513 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Menno
Top achievements
Rank 1
Menno asked on 23 Jul 2007, 06:49 AM
How is Telerik going to implement the upcoming LINQ technology in it's products?

I think LINQ could be used to enable RadTreeView to use regular IEnumerable collections of objects for instance. Now you have to write the recursive code to build the tree yourself but with LINQ support you can simply specify the DataFieldID and DataFieldParentID properties.

In short I'm looking forward to seeing how Telerik uses this new technology.

7 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 23 Jul 2007, 11:03 AM
Hello Olav Snoek,

Thanks for that question.

Actually, RadTreeView can be bound to any class that implements the IEnumerable interface. Furthermore, you can specify ID->ParentID relation by using the DataFieldID and DataFieldParentID properties as described in the Overview and types of data sources help article.

As for the LINQ technology, this is yet another way to query your datasource. You should be able to use it regardless to the databinding mechanism of RadTreeView.

Kind regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Menno
Top achievements
Rank 1
answered on 23 Jul 2007, 11:48 AM
Dear Nick,

I know you can already bind any IEnumerable collection to the TreeView but setting the  DataFieldID and DataParentID properties has no effect. I would like to be able to bind any IEnumeralbe  collection  to the  control  and  be  able  to create a hierarchy. This is currently not possible. If there was a check if the datasource implements IQueryable it would be simple to implement this using any IEnumerable collection.

2. Data Sources from which Telerik RadTreeView cannot create treeview item hierarchy

When the treeview is bound to such Data Sources it is flat, i.g. it has only root items

 - root node 1 

 - root node 2

Setting DataFieldID and DataFieldParentID will have no effect.

 


0
Nikolay
Telerik team
answered on 23 Jul 2007, 03:34 PM
Hi Olav Snoek,

Thanks for the provided details. I logged your request in our To-Do list for further consideration. This would surely be a complicated task to achieve. We will, however, research the matter to find the most appropriate approach to use.

Once again, thank you for your involvement.

Regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Menno
Top achievements
Rank 1
answered on 30 Jul 2007, 09:00 AM
Hi,

I just tried binding a RadTreeView to the new LinqDataSource in Visual Studio 2008 and then (as expected) the tree also does not bind hierarchically.

<asp:linqdatasource id="LinqDataSource1" runat="server"  
    contexttypename="Layers.Data.OrganizationDataContext" tablename="Organizations"
</asp:linqdatasource> 
<radt:radtreeview id="RadTreeView1" runat="server" datafieldid="Organization_ID" 
    datafieldparentid="Parent_ID" datatextfield="Name"  
    datavaluefield="Organization_ID" datasourceid="LinqDataSource1"
</radt:radtreeview> 

I do think you should seriously consider providing support for hierarchical tree binding using the new Linq framework. I really don't think it would be very complex to implement as all IEnumerable objects now can get extended with LINQ methods.

Best regards,

Olav
0
Helen
Telerik team
answered on 30 Jul 2007, 02:49 PM
Hi,

We will consider adding such a feature in the near future. In the meantime you may find worthwhile reviewing the following blog post - Hierarchical data sources and RadControls .

Best regards,
Helen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mike
Top achievements
Rank 1
answered on 21 Apr 2008, 04:42 PM
Has this been implemented in Telerik yet? I am having the same issue with the RadPanelBar.  Thanks
0
Atanas Korchev
Telerik team
answered on 22 Apr 2008, 06:44 AM
Hello Mike,

There is no built-in support for hierarchical binding to LinqDataSource. Unfortunately the LinqDataSource does not implement the IHierarchicalDataSource interface which is required for seamless hierarchical databinding.
Nevertheless our development team will continue researching for any possible workarounds. Once there is a progress we will announce it.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Menno
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Menno
Top achievements
Rank 1
Helen
Telerik team
Mike
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or