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

binding radgrid to sub-collection of objects

1 Answer 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 16 May 2016, 08:48 PM

So I have this binding problem

I want to bind a radgrid to List<Class1>

On the grid I want to display the following columns:

UserName

Make

Model

 

I also want the Make and Model to be grouped by UserName

 

The classes:

 

    public class Class1

    {

        public Class1()

        {

            Class2Objects = new List<Class2>();

        }

 

        public string Username { get; set; }

 

        public List<Class2> Class2Objects { get; set; }

 

   }

 

Public class Class2

{

               Public string Make{get;set;}

               Public string Model{get;set;}

}

 

The issue is I don't know how to bind to the sub-collection Class2Objects property of Class1

Can this be done

 

Thanks,

William

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 19 May 2016, 04:59 PM
Hi William,

Regarding the grouping, I am not sure what you mean by grouping the Make and Model by UserName, because the grouping is performed on a data field. Can you please elaborate on the exact requirement that you have and what is the final result that you are after? 


Regards,
Konstantin Dikov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
General Discussions
Asked by
William
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or