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

[Solved] Groups with key, display, and sort values?

1 Answer 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Levi
Top achievements
Rank 1
Levi asked on 07 Nov 2011, 03:44 PM
I'm running a grid with Ajax binding with added groups:

.Groupable(grouping => grouping
    .Groups(groups =>
    {
        for (int i = 0; i < TagGroups.Count; i++)
        {
           groups.Add(c => c.Tags[i].Name);
        }
    })
)

This is grouping the data by the Name property. In essence, the Name property is being used for three jobs. It is acting as the group key, it is the displaying value, and is used to sort the groups alphabetically.

I want to specify the property for each of these jobs. I want the Id property to act as the group key, the Name property to act as the display value, and the Order property to act as the sort value numerically instead of alphabetically.

If this is a tall order, I can live with the Name property as the group key and display value, but I need to specify the Order property as the sort value. Any thoughts? I'd prefer not tinkering with back-end data with Linq or such, because It makes a lot of sense to just configure a Telerik Grid to do this.

1 Answer, 1 is accepted

Sort by
0
Levi
Top achievements
Rank 1
answered on 09 Nov 2011, 03:08 PM
Basically, how can I change the order method from alphabetical of the group value to numerical of the group's Order property?
Tags
Grid
Asked by
Levi
Top achievements
Rank 1
Answers by
Levi
Top achievements
Rank 1
Share this question
or