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

RadGridView Nested Collection Binding

1 Answer 135 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
nitika
Top achievements
Rank 1
nitika asked on 03 May 2017, 05:06 PM

Hi,

I want to achieve a radgrid view with nested collection. The twist is binding should create a new column and not like row details.

E.g. My data looks like

List<class1> lstObj1 = new List<class1>();

public class1

{

public string name;

public string id;

public List<class2> objClass2List = new List<class2>();

}

public class2

{

public string sub1;

public string sub2;

}

 

View should be like as attached:

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 08 May 2017, 12:22 PM
Hello Nitika,

Thank you for the image provided.

You should be able to achieve this by adding columns programmatically to the Columns collection of RadGridView. You just need to set the DataMemberBinding of the column to point to the needed property of the nested object. Would such an approach be working for you or I am missing something?

Best Regards,
Stefan X1
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
General Discussions
Asked by
nitika
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or