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

Setting culture not working in Edit functionality of Grid

3 Answers 214 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Achilles
Top achievements
Rank 1
Achilles asked on 13 Nov 2013, 08:38 AM
Hi,

I have a Kendo grid on which I apply batch editing on a column which represents a decimal. I have set the culture to "de-DE". If I set the format of the column explicitly as Format("{0:N}"), I see the decimal separator correctly as (,). But as soon as I go to the edit mode by clicking on the text, it changes to (.).
Strangely, if I edit the text and come out of the edit mode, A comma(,) is interpreted as a decimal separator. But an existing (.), if not replaced becomes a thousand's separator.

I've written a stand-alone application which I've attached. In this stand-alone I have an added problem. The "Save changes", "Cancel changes" & "x of y items" are not translated. In my actual application, this problem is not there. Am I doing something wrong in applying the culture ? The date widget (in sample) seems to be working fine.

Thanks & Regards

Achilles 

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 15 Nov 2013, 08:34 AM
Hello Achilles,

You should use a numerictextbox for the editor in order for the number to be displayed in the correct format. I attached the project with the needed modifications added.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Achilles
Top achievements
Rank 1
answered on 20 Nov 2013, 06:39 AM
Hi Daniel,
I have followed your advice and now the numbers are displayed in the correct format as per culture. I can also edit correctly in the numerictextbox.
Thanks.

Now I have another problem. When I try to save the edited data, if the data has a fraction, the model somehow becomes invalid.
So if I have unsaved data as "9,81" in German, this is what I see
POST : "sort=&group=&filter=&models%5B0%5D.Date=01.09.2011+12%3A00%3A00&models%5B0%5D.Etoday=9.81"<br>
RESPONSE : {"Data":[{"Date":"\/Date(1314858600000)\/","Etoday":0}],"Total":1,"AggregateResults":null,"Errors":{"models[0].Etoday":{"errors":["The value \u00279.81\u0027 is not valid for Etoday."]}}}


I see the same error in the server side.

Unfortunately, I cannot reproduce the phenomenon on the sample I had provided you. Here everything seems to work correctly.

POST : "sort=&group=&filter=&models%5B0%5D.Date=03.11.2013+00%3A00%3A00&models%5B0%5D.Etoday=9.81&models%5B0%5D.Edited=false"<br>
RESPONSE : {"Data":[{"Date":"\/Date(1383417000000)\/","Etoday":9.81,"Edited":false}],"Total":1,"AggregateResults":null,"Errors":null}


Any hint where I should look for the problem would be appreciated.

Regards

Achilles
0
Daniel
Telerik team
answered on 21 Nov 2013, 11:58 AM
Hello again Achilles,

Please try with the latest official release. The numbers were not serialized based on the culture in the previous versions and it was necessary to format the values in the request Data function or to use a culture invariant binder.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Achilles
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Achilles
Top achievements
Rank 1
Share this question
or