Is it possible to control the order of the groups on the grid, or disable grid's ordering mechanism and just display it in the order data is fed to the grid. Unfortunatelly, domain entities are fed directly to the UI and they do not have any meaningful attribute upon which to set the group expression. Here is how the data is being fed to the grid, and I would like the grid not to change the order.
| this.BaseProductBenefitsGrid.DataSource = Benefits |
| .OrderBy(b => |
| { |
| switch (b.BenefitServiceGroup) |
| { |
| case "Inpatient": |
| return 1; |
| case "Outpatient": |
| return 2; |
| case "Other": |
| return 3; |
| } |
| return 4; |
| }).ThenBy(b => b.Type.DisplayOrderNumber).ToList(); |
| BaseProductBenefitsGrid.DataBind(); |
and here is the group expression
| <GroupByExpressions> |
| <telerik:GridGroupByExpression > |
| <SelectFields > |
| <telerik:GridGroupByField HeaderText="-" FieldName="BenefitServiceGroup" HeaderValueSeparator=" " SortOrder="None" /> |
| </SelectFields> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldName="BenefitServiceGroup" /> |
| </GroupByFields> |
| </telerik:GridGroupByExpression> |
| </GroupByExpressions> |
so I would think that it should be possible to have groups ordered as Inpatient, Outpatient, Other. But grid reverses it and displays it as Inpatient, Other, Outpatient.