RadGrid NotBetween not working correctly

2 posts, 0 answers
  1. Diego
    Diego avatar
    9 posts
    Member since:
    Jun 2018

    Posted 05 Sep 2019 Link to this post


    We've been doing tests with the Trial 2019 version of Telerik and we have the following problem:

    We have a string type column that can contain both string and decimal values depending on the information that the user needs to display. When the user needs to filter by between (for example, between 2 and 20), the filter works perfectly and the proper values are being displayed.

    However, when the NotBetween filter is used, some values are being filtered out while others are being displayed even though they're inside the range, if we use "NotBetween" for values 0 and 10, values like 2,21 and 4,556 are being shown despite clearly being inside the range.

    Is there any fix for this problem or is filtering String columns by NotBetween not an acceptable use case? Thank you for your help.

  2. Attila Antal
    Attila Antal avatar
    520 posts

    Posted 10 Sep 2019 Link to this post

    Hi Diego,

    In programming, comparing strings does not work the same way as comparing numbers. If you wish to compare the string values as if they were numbers, you will need to convert them to numbers first, then compare them.

    The same applies in your case. For the sake of handling the data by its type, RadGrid has built-in columns such as  Numeric column, Date, Image, Link and more: RadGrid - Column Types.

    In order to make the filter handle the data accord to its type, you can try using GridNumericColumn, or setting the DataType property of the column to System.Decimal. In some cases, you may also want to bind decimal type of data to the column.


    I hope this will help resolve the issue.


    Kind regards,
    Attila Antal
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top