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

Show Sort Image

1 Answer 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
avarndel
Top achievements
Rank 1
avarndel asked on 19 Aug 2008, 02:54 PM
How can I always have the sort images showing whether or not the column has been sorted?

thx

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 19 Aug 2008, 03:18 PM
Hi,

The desired functionality can be achieved like this:


<telerik:RadGrid 
    ID="RadGrid3" 
    runat="server" 
    AllowSorting="true" 
    OnSortCommand="RadGrid3_SortCommand"
    <MasterTableView AllowCustomSorting="true"
        <SortExpressions> 
            <telerik:GridSortExpression FieldName="..." SortOrder="Ascending" /> 
        </SortExpressions> 
    </MasterTableView> 
</telerik:RadGrid> 


In this case RadGrid will not sort the data and the indicator will appear. The only thing to do more is to set AllowCustomSorting="False" on sort command, so that RadGrid starts sorting afterwards, when the user clicks on the header:


protected void RadGrid3_SortCommand(object sender, GridSortCommandEventArgs e) 
    RadGrid3.MasterTableView.AllowCustomSorting = false



Greetings,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
avarndel
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or