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

DataGrid Grouping when binding to class that contains collections of other classes.

1 Answer 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ashley
Top achievements
Rank 1
Ashley asked on 26 Sep 2012, 05:38 AM
Hi,

I have a data structure similar to the one below where one class contains a colleciton of another class as one of it's fields:

Product
{
    String name
    String desription
    Address[] addresses
}

Address
{
    String state
    String suburb
}

Within a data grid which I am binding to the Product class, I want to display only the Product "name" field but have it grouped by the "state" field of the first item of the addresses collection (within my data I am ensuring that every Product has at least one Address)

So my data grid would look somthing like:

VIC
    - Product Name 1
    - Product name 2
NSW
    - Product Name 3
    - Product Name 4

Is this possible? To date I can only get grouping working on fields within the Business (or top level) class, not fields from the Address (or nested) class.

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 29 Sep 2012, 10:37 PM
Hello Ashley,

I am sorry to say that the current implementation of the RadGrid does not support this kind of logic. You can achieve your goal using many-to-many relational database and a hierarchical structure. To get an idea for the practical realization you could take a look at the following post.

Regards,
Angel Petrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Ashley
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or