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

GridView Filter shows erroneous values for rounded decimal values

1 Answer 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 30 May 2014, 02:31 PM
Hi,
I have created a basic RadGridView with one of the bindable values being a double. When populating the collection I just create a random double that I round to 2 decimal values. This shows up in the GridView perfectly. But when I select the filter for this column the values are erroneous to what should be displayed. So say I have a row value of 39.02, then the filter option for this is 39.0200004577637. See attach file.

Why is it doing this ?

Cheers ... Rob.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 02 Jun 2014, 07:42 AM
Hello Rob,

Indeed, your observations are right.

This is actually a known issue with the decimal values displayed in the stock Silverlight ListBox that is used inside the FilteringControl for displaying DistinctValues. 

What you can do to avoid such inconvenience is to define a StringFormat for the Binding, or a DataFormatString for the column (for example DataFormatString="{}{0:N2}").

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Rob
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or