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

Descending order in RADGrid

3 Answers 275 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sucheta Patil
Top achievements
Rank 1
Sucheta Patil asked on 02 Feb 2011, 06:00 PM
Hi
I have a RadGrid in my form.
There is data displayed for visitors from Visitors table.
I want the data to be displayed in descending order, so that the latest visitor filled via a form should be seen first in the grid.

Any dvice is helpfull.
Thanks
Sucheta

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Feb 2011, 05:32 AM
Hello Sucheta,

You can specify the SortExpressions property collection declaratively to provide an initial sort order.
aspx:
<telerik:RadGrid ID="RadGrid1" AutoGenerateEditColumn="true" runat="server" >
            <MasterTableView .................>
                 <SortExpressions>
                    <telerik:GridSortExpression FieldName="EmployeeID" SortOrder="Descending" />
                 </SortExpressions>
                    .....................
</telerik:RadGrid>

Also refer the following documentation for more on sorting expressions.
Sorting

Thanks,
Shinu.
0
Sucheta Patil
Top achievements
Rank 1
answered on 03 Feb 2011, 05:51 PM
Hi
I tried the code you gave.
It  gives me the following error.

Literal content ('<telerik:GridSortExpressionFieldName="ID"SortOrder="Descending"/>') is not allowed within a 'Telerik.Web.UI.GridSortExpressionCollection'

Any help is appriciable.
Sucheta
0
Sucheta Patil
Top achievements
Rank 1
answered on 04 Feb 2011, 03:09 PM
Thanks,
 it worked.
Tags
Grid
Asked by
Sucheta Patil
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Sucheta Patil
Top achievements
Rank 1
Share this question
or