This is a migrated thread and some comments may be shown as answers.

error when filtering a column with datatype double

4 Answers 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul Evers
Top achievements
Rank 2
Paul Evers asked on 21 Jun 2012, 07:20 AM
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

4 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 21 Jun 2012, 04:47 PM
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.
0
Paul Evers
Top achievements
Rank 2
answered on 22 Jun 2012, 07:53 AM
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
0
Accepted
Eyup
Telerik team
answered on 22 Jun 2012, 01:45 PM
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.
0
Paul Evers
Top achievements
Rank 2
answered on 25 Jun 2012, 12:33 PM
After I updated the project from Q1 2012 to Q2 2012 this problem was solved.

Paul
Tags
Grid
Asked by
Paul Evers
Top achievements
Rank 2
Answers by
Eyup
Telerik team
Paul Evers
Top achievements
Rank 2
Share this question
or