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.
Both Name & Order are bound columns in the grid. Use only Order in the Groupable list. Then in your grid DataBound(), replace each order with the corresponding Name property.