error when filtering a column with datatype double

5 posts, 1 answers
  1. Paul Evers
    Paul Evers avatar
    52 posts
    Member since:
    Oct 2011

    Posted 21 Jun 2012 Link to this post

    Hi,

    I have a RadGrid with filter enabled in the headercontextmenu
    AllowFilteringByColumn="True" EnableHeaderContextFilterMenu="True"

    In this grid I have several columns with DataType double.
    In the headercontextmenu for a column with datatype double it is possible to enter a string like xx.
    I get the next error when I enter xx:
    No property or field 'xx' exists in type 'DataRowView'
    This is indeed a logical error because xx is not a valid double value.

    How can I allow only numbers and the decimalseparator to be entered in the filter?

    Paul
  2. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 21 Jun 2012 Link to this post

    Hello Paul,

    Please try to declare your columns with defined DataType="System.Double" as GridNumericColumns as demonstrated in the following demo:
    Grid / Header Context Filter Menu

    Greetings,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul Evers
    Paul Evers avatar
    52 posts
    Member since:
    Oct 2011

    Posted 22 Jun 2012 Link to this post

    Thank you, this works.

    But now I run into another problem.
    In a column that I defined as GridNumericColumn I have negative and positive values.
    When I set the filter to greater that 1 the filter works fine, but when I set the filter to greater than 0 the filter is not applied and is reset to NoFilter.
    I did some experiments:
    Greater than 0.1 does work
    Greater than 0.01 does work
    Greater than 0.001 results in NoFilter
    Greater than 0.099 results in greater than 0.09

    Why does a filter 'Greater than 0' reset to NoFilter?

    Paul
  5. Answer
    Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 22 Jun 2012 Link to this post

    Hello Paul,

    Attached you will find a sample RadGrid web side where I demonstrated that filtering a numeric column works as expected. Please check out the provided application and try to distinguish the crucial differences between our projects.

    Kind regards,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Paul Evers
    Paul Evers avatar
    52 posts
    Member since:
    Oct 2011

    Posted 25 Jun 2012 Link to this post

    After I updated the project from Q1 2012 to Q2 2012 this problem was solved.

    Paul
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017