I'm working on a grid that implements the grouping functionality and we are having an issue when attempting to sort the groups ascending or descending. The grouping field is an item number and needs to be sorting by value, however we can't seem to get it to not sort alphabetically (Item 10 always comes before Item 2). The associated column is an integer, so ideally it should sort numerically.
Is it possible to sort by just the group's value and not the formatted string? We currently have it formatted as "Item #", however we can strip any extra characters if necessary.
Is it possible to sort by just the group's value and not the formatted string? We currently have it formatted as "Item #", however we can strip any extra characters if necessary.
<
telerik:RadGrid
SkinID
=
"Paging"
ID
=
"ResultsGrid"
runat
=
"server"
AllowCustomPaging
=
"True"
AllowPaging
=
"False"
OnInit
=
"DataGridInit"
OnItemDataBound
=
"BindColumnValues"
OnNeedDataSource
=
"DataGrid_NeedDataSource"
OnItemCreated
=
"ItemManipulation"
OnSortCommand
=
"PerformSort"
OnItemCommand
=
"ResultsGridItemCommand"
ShowGroupPanel
=
"true"
AutoGenerateColumns
=
"false"
GridLines
=
"none"
ShowFooter
=
"false"
EnableLinqExpressions
=
"false"
>
<
PagerStyle
Mode
=
"NextPrevNumericAndAdvanced"
></
PagerStyle
>
<
GroupingSettings
ExpandTooltip
=
"Expand"
CollapseTooltip
=
"Collapse"
/>
<
MasterTableView
Summary="<%$ Resources: ResultsTableSummary %>" ShowGroupFooter="true"
ClientDataKeyNames=""
DataKeyNames="ItemDocumentKey,FundingKey" CssClass="rgWrapFalse">
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"ItemNumber"
DataField
=
"ItemNumber"
HeaderText="<%$
Resources: PostAwardCommon, ItemNumber %>" DataType="System.Int32"
Visible="false"/>
<
telerik:GridBoundColumn
UniqueName
=
"ShipToCode"
DataField
=
"ShipToCode"
HeaderText="<%$ Resources: Common, DeliverTo %>" DataType="System.String"
SortExpression="ShipToCode" />
<
telerik:GridBoundColumn
DataField
=
"AccountId"
HeaderText="<%$ Resources: PostAwardCommon, AccountId %>" UniqueName="AccountId" AllowSorting="true"/>
<
telerik:GridBoundColumn
DataField
=
"AccountCode"
HeaderText="<%$ Resources: PostAwardCommon, AccountingCode %>" UniqueName="AccountCode" AllowSorting="true"/>
<
telerik:GridBoundColumn
DataField
=
"AwardedAmount"
HeaderText="<%$ Resources: PostAwardCommon, Awarded %>" AllowSorting="true"
UniqueName="AwardedAmount" HeaderStyle-CssClass="rgHeader width30 rgHeaderAlignLeft" ItemStyle-HorizontalAlign="Right"/>
<
telerik:GridBoundColumn
DataField
=
"AcceptedToDate"
HeaderText="<%$ Resources: PostAwardCommon, AcceptedtoDateHeaderText %>" AllowSorting="true"
UniqueName="AcceptedToDate" HeaderStyle-CssClass="rgHeader width45 rgHeaderAlignLeft" ItemStyle-HorizontalAlign="Right"/>
<
telerik:GridBoundColumn
DataField
=
"RemainingAmount"
HeaderText="<%$ Resources: PostAwardCommon, Remaining %>" AllowSorting="true"
UniqueName="RemainingAmount" HeaderStyle-CssClass="rgHeader width30 rgHeaderAlignLeft" ItemStyle-HorizontalAlign="Right"/>
<
telerik:GridBoundColumn
UniqueName
=
"AcceptedDate"
HeaderText="<%$ Resources: PostAwardCommon, ActualAcceptedDate %>"
ItemStyle-HorizontalAlign="Center" />
<
telerik:GridBoundColumn
UniqueName
=
"AcceptedAmount"
FooterStyle-HorizontalAlign
=
"Left"
FooterText
=
"Total Accepted: "
GroupByExpression
=
"AcceptedAmount Group By AcceptedAmount"
DataType
=
"System.Double"
Aggregate
=
"Sum"
DataField
=
"AcceptedAmount"
ItemStyle-HorizontalAlign
=
"Right"
/>
</
Columns
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldAlias
=
"ItemNumber"
HeaderText="<%$ Resources: PostAwardCommon, ItemNumber %>" FieldName="ItemNumber"></
telerik:GridGroupByField
>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"ItemNumber"
SortOrder
=
"Ascending"
></
telerik:GridGroupByField
>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
</
MasterTableView
>
</
telerik:RadGrid
>