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

Remove NoSort option From Sorting

4 Answers 25 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 13 Jul 2014, 02:41 PM
Hello,

I am currently working on a project with a RadGrid.

I need only two types of sorting - Ascending and Descending (I
want to turn off “NoSort” option).

I looked into your documentation and saw that setting:
 [http://www.telerik.com/help/aspnet-ajax/grid-controlling-sorting-modes.html]

VB.NET:
RadGrid1.MasterTableView.AllowNaturalSort = False

But unfortunately it does not work for me.

Please see the following video:

http://youtu.be/2oZ-y7J1P2c 


It gives me all 3 options (Ascending, Descending, NoSort).

Thanks for your help,

Daniel.

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 15 Jul 2014, 07:24 AM
Hi Daniel,

Try setting a default filter to the Grid along with AllowNaturalSort = False.

VB:
Dim expression As GridSortExpression = New GridSortExpression()
expression.FieldName = "ID"
expression.SortOrder = GridSortOrder.Descending
RadGrid1.MasterTableView.SortExpressions.AddSortExpression(expression)
RadGrid1.MasterTableView.Rebind()

Thanks,
Princy
0
Daniel
Top achievements
Rank 1
answered on 15 Jul 2014, 12:29 PM
Hello Princy 

Thank you sharing the solution with me.
However, it does not work for me. 

I attached code showing the problem I have.
VB Code
 
Thank you, 

Daniel.
0
Accepted
Princy
Top achievements
Rank 1
answered on 16 Jul 2014, 03:50 AM
Hi Daniel,

Please remove the RadGrid1.MasterTableView.Rebind() from the Page_Load and see if this issue exist. Removing this line of code, I was able to get your sample run without any issue at my end.

Thanks,
Princy
0
Daniel
Top achievements
Rank 1
answered on 16 Jul 2014, 07:13 AM
Hi Princy,

Thank you for the solution.

When I remove RadGrid1.MasterTableView.Rebind() from the Page_Load it does not help.

But if I move RadGrid1.MasterTableView.AllowNaturalSort = False from the Page_Load  to other sub or function it Work!!
(eg: into NeedDataSource)


Many thanks,

Daniel.
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Daniel
Top achievements
Rank 1
Share this question
or