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

Databinding to data structure

1 Answer 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Miloš Sommer
Top achievements
Rank 1
Miloš Sommer asked on 20 Jun 2011, 10:00 AM

HelIo,

I have a structure that looks like following:

Class TreeNode  { 
   
public TreeNode Parent { get; } 
   
public IEnumerable<TreeNode> Children { get; } 
   
public …  

I want to bind this structure to a Telerik RadGrid with detail tables for each level of the children. I know that radgrid supports declarative binding to a self-referencing hierarchy, but that assumes you have a flat dataset (e.g. from a database) and can look at a parent key field of some sort. My question is: It is possible to bound a radgrid to a data structure like the one I mentioned and is there a way to do it declaratively?

Thanks in advance,

Misa

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 22 Jun 2011, 07:37 PM
Hi Michaela Košutová,

Thank you for writing.

Please take a look at the following article in our product documentation. It provides detailed information on how to create hierarchy based on a complex IList (IEnumarable) object that contains inner ILits (IEnumerable) properties. 

Hope this helps. Let me know if you have any additional questions.

Kind regards,
Martin Vasilev
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
Miloš Sommer
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or