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

RadDataFilter with German Values (0,01)

1 Answer 31 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 11 Sep 2013, 06:05 PM
We are trying to build a FilterDestriptor with FilterValues in German format for numeric decimal Values.

In German Culture ("de-DE") the double value 0.1 is written 0,1 (with comma), but FilterDesriptor will not parse this correctly although the thread's CurrentCulture is German. So "0,1" will be parsed incorrectly as 1.0D when using the constructor to build a FilterDescriptor:

FilterDescriptor mydescriptor = FilterDescriptor(FilterMember, FilterOperator, "0,1", FilterIsCaseSensitive);

Where can I set the culture to use for number conversion???

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 12 Sep 2013, 09:07 AM
Hello,

If the FilterDescriptor.Value is supposed to be a .NET number (i.e. double) -- supply an actual .NET number -- not a string. There is no one to parse a string and convert in into a number for you. You can do that in your code if you need to.

FilterDescriptor mydescriptor = FilterDescriptor(FilterMember, FilterOperator, 0.1, FilterIsCaseSensitive);

Obtaining this double value of 0.1 is your task. For example, you can use Double.TryParse which will respect the current culture and parse the German string. Pass the actual .NET double to the FilterDescriptor and will be well.

In the end -- all that .NET cares about is this double value. How it was obtained is none of its concern.

I hope this helps.

Regards,
Rossen Hristov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
DataFilter
Asked by
Peter
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or