RadGridView Nested Collection Binding

2 posts, 0 answers
  1. nitika
    nitika avatar
    1 posts
    Member since:
    May 2017

    Posted 03 May Link to this post

    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:

  2. Stefan X1
    Admin
    Stefan X1 avatar
    752 posts

    Posted 08 May Link to this post

    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.
Back to Top