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

display defalut sorted column

1 Answer 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
prayag ganoje
Top achievements
Rank 1
prayag ganoje asked on 22 Jul 2011, 12:01 PM
hello,

I want to display one grid column as a sorted column since query result is sorted by that column values.

Well, i dont know the best way to display it but i found following code on the forum.
After applying that code grid appears to be hanged and then none of the column can be sorted on clicking the column header.
Protected Sub rg_Edit_Report_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles rg_Edit_Report.PreRender
    Dim SortExp As New GridSortExpression()
    SortExp.FieldName = "CASE"
    SortExp.SortOrder = GridSortOrder.Ascending
    rg_Edit_Report.MasterTableView.SortExpressions.Add(SortExp)
    rg_Edit_Report.MasterTableView.Rebind()
End Sub

Can you please suggest me the best way to display the sorted column by default without hampering other features of radGrid ?

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 22 Jul 2011, 01:46 PM
Hello Prayag,

You can achieve this by setting the SortExpressions to show default sorted column.

aspx:
<SortExpressions>
      <telerik:GridSortExpression FieldName="CASE" SortOrder="Ascending" />
</SortExpressions>

Thanks,
Princy
Tags
Grid
Asked by
prayag ganoje
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or