Sort Nulls To The End Of The List

3 posts, 1 answers
  1. Steven
    Steven avatar
    39 posts
    Member since:
    Jul 2012

    Posted 18 Mar 2013 Link to this post

    Hi,

    I have a RadGridView with a large number of columns which are bound to decimal values. Currently when you sort the columns null values are always sorted to have lowest value.

    However, our client would like for nulls to always be sorted to the end of the list when the column is sorted in both ascending and descending modes.

    I was wondering if there was a way to achieve this with having to do something for each column individually?

    Thanks,

    Steven
  2. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 18 Mar 2013 Link to this post

    Hello,

    I am afraid that we use the .NET Framework to do the sorting and we cannot change its sorting logic.

    The only possible way I can think of would be to use some custom class instead of decimal and to implement the IComparable or IComparable<T> interface on this class so that the .NET Framework uses it for sorting.

    Greetings,
    Rossen Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Steven
    Steven avatar
    39 posts
    Member since:
    Jul 2012

    Posted 19 Mar 2013 Link to this post

    Thanks for the quick reply.

    Steven
Back to Top