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

Sort Grid Bound column with grouping

1 Answer 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael Nagy
Top achievements
Rank 2
Michael Nagy asked on 28 Jan 2009, 06:43 PM
hello ,
i have a rad grid with 3 column
  <telerik:GridBoundColumn HeaderText="Name" UniqueName="Name" DataField="Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Description" UniqueName="Description" DataField="Description">
                </telerik:GridBoundColumn>
                <telerik:GridDropDownColumn HeaderText="Building" UniqueName="Building" DropDownControlType="DropDownList"
                    DataField="Building" AllowSorting="true" SortExpression="OfficeName">
                </telerik:GridDropDownColumn>

and i am using group setting
            <GroupByExpressions>
                <telerik:GridGroupByExpression>
                    <SelectFields>
                        <telerik:GridGroupByField FieldName="BuildingName" FieldAlias="OfficeName" HeaderText="Office Name" />
                    </SelectFields>
                    <GroupByFields>
                        <telerik:GridGroupByField FieldName="BuildingName" SortOrder="Ascending"></telerik:GridGroupByField>
                    </GroupByFields>
                </telerik:GridGroupByExpression>
            </GroupByExpressions>

the problem when click on Building column to sort the grid by BuildingName nothing happened . when i removed the group of BuildingName sorting working well so think this is an issue when sort a column that has a group by field value at grip group setting so i think i need to change the sort order of the group field at sort command for this grid . please provide me a code that make change  sort order at sort command


1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 30 Jan 2009, 10:38 AM
Hello Michael,

Try setting the SortExpression for the GridDropDownColumn to "BuildingName". The SortExpression should match the DataField of a column in your database:
aspx:
    <telerik:GridDropDownColumn HeaderText="Building" UniqueName="Building" DropDownControlType="DropDownList" DataField="Building" AllowSorting="true" SortExpression="BuildingName"
    </telerik:GridDropDownColumn> 

Thanks
Princy.
Tags
Grid
Asked by
Michael Nagy
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or