Hi Telerik,
I have an issue with the RadGrid.
I have grouped the records in the grid using the "Grouping" property of RadGrid. The grouping is done for the names of certain persons. Here is the associated code:
<GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldName="Name" HeaderText="Name" />
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName="Name" HeaderText="Name" />
</GroupByFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>
The grouping works fine. But the names appear in their alphabetical order and I dont want that.
I'm binding the data from database. I have given the "order by" clause, but still its not working. I want the names appear in the grid in the order they are stored in the database table. I think the grouping has caused the problem.
Can you please suggest a way to avoid the alphabetical order display while grouping?
Thanks,
Pradeep Y.
| protected void rgEnvironments_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridEditableItem && e.Item.IsInEditMode && e.Item.OwnerTableView.Name != "environments") |
| { |
| GridDataItem dataItem = e.Item.OwnerTableView.ParentItem; |
| int id = Intranet.Str2Int(dataItem.GetDataKeyValue("system_id").ToString()); |
| GridEditableItem moduleEdited = (GridEditableItem)e.Item; |
| GridEditableItem editItem = (GridEditableItem)e.Item; |
| Literal msv = (Literal)moduleEdited.FindControl("ltlModuleEdit"); // Grab selectedvalue from hidden literal |
| RadComboBox moduleCombo = (RadComboBox)moduleEdited["module"].FindControl("rcbModule"); |
| moduleCombo.DataSource = GetModuleDataTable(id); |
| moduleCombo.DataTextField = "module"; |
| moduleCombo.DataValueField = "module_id"; |
| moduleCombo.DataBind(); |
| if (null != msv) |
| moduleCombo.SelectedValue = msv.Text; |
| } |
| } |
| <telerik:GridTemplateColumn HeaderText="Module" UniqueName="module" HeaderStyle-Width="16%"> |
| <ItemTemplate> |
| <asp:Literal ID="ltlModule" Text='<%# Bind("module") %>' runat="server" /></ItemTemplate> |
| <EditItemTemplate> |
| <asp:Literal ID="ltlModuleEdit" Text='<%# Bind("module_id") %>' Visible="false" runat="server" /> |
| <telerik:RadComboBox ID="rcbModule" runat="server" Skin="Default" /> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |