Sort Grid Bound column with grouping

2 posts, 0 answers
  1. Michael Nagy
    Michael Nagy avatar
    18 posts
    Member since:
    May 2008

    Posted 28 Jan 2009 Link to this post

    hello ,
    i have a rad grid with 3 column
      <telerik:GridBoundColumn HeaderText="Name" UniqueName="Name" DataField="Name">
                    <telerik:GridBoundColumn HeaderText="Description" UniqueName="Description" DataField="Description">
                    <telerik:GridDropDownColumn HeaderText="Building" UniqueName="Building" DropDownControlType="DropDownList"
                        DataField="Building" AllowSorting="true" SortExpression="OfficeName">

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

    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

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 30 Jan 2009 Link to this post

    Hello Michael,

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

Back to Top