Sorting a grid bound to a DataTable

3 posts, 1 answers
  1. Jose Simas
    Jose Simas avatar
    35 posts
    Member since:
    Mar 2009

    Posted 14 Jul 2011 Link to this post

    Hi,


    I have a DataTable with numeric data that is bound to a RadGridView. When I sort a column by clicking the grid's header it is sorted by that column which is correct. The problem is that the sort applied to the column is a string sort and I would like it to sort numerically. I looked in the grid documentation under Sorting to no avail. Could you please tell me how this is done?


    Best Regards,
    Jose
  2. Answer
    Milan
    Admin
    Milan avatar
    1989 posts

    Posted 15 Jul 2011 Link to this post

    Hi Jose Simas,

    Well, if the data that is being sorted is of type string it is natural to get such sorting. The only way to get numeric sorting is to have numeric data. Please convert your string data to numeric format.

    Kind regards,
    Milan
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for WPF is Visual Studio 2017 Ready
  4. Jose Simas
    Jose Simas avatar
    35 posts
    Member since:
    Mar 2009

    Posted 15 Jul 2011 Link to this post

    Hi Milan,

    Thanks for that, it sent me on the right path, it is indeed my mistake as some of the columns of the DataTable were of type string instead of double.

    Best Regards,
    Jose
Back to Top