Remove NoSort option From Sorting

5 posts, 1 answers
  1. Daniel
    Daniel avatar
    159 posts
    Member since:
    Feb 2014

    Posted 13 Jul 2014 Link to this post

    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.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 Jul 2014 in reply to Daniel Link to this post

    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
  3. Daniel
    Daniel avatar
    159 posts
    Member since:
    Feb 2014

    Posted 15 Jul 2014 in reply to Princy Link to this post

    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.
  4. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 Jul 2014 in reply to Daniel Link to this post

    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
  5. Daniel
    Daniel avatar
    159 posts
    Member since:
    Feb 2014

    Posted 16 Jul 2014 in reply to Princy Link to this post

    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.
Back to Top