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

[Solved] Sometimes wrong culture displayed for Date

6 Answers 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Frank Michael
Top achievements
Rank 1
Frank Michael asked on 04 May 2010, 11:03 PM
I have this code:

 Html.Telerik().Grid<RenderSprint>() 
        .BindTo(Model) 
        .Name("SprintGrid"
        .Localizable("de-DE"//ToDo Culture allgemein ersetzen 
        .ToolBar(tb => {  
            tb.Insert(); 
            tb.Custom().Action<SprintController>(sc => sc.Aggregate()).Text("Aggregate"); // ToDo hier muss ich Ajax machen.   
        }) 
// shortened 

Most of the time the date displays german. But not always. Strange things are happening.


6 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 05 May 2010, 07:31 AM
Hi Frank Michael ,

We are not sure how to reproduce this problem based on your description. Could you reproduce this problem in our online demo?

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Frank Michael
Top achievements
Rank 1
answered on 05 May 2010, 01:10 PM
The phenomenon happens in this way:

1) View enter - all dates are displayed in german.
2) Click Row Edit - The editable field of Date is displayed in us culture.
3) If I save in this situation the day and the month is exchanged. I.e. if it was 1.3.2010 in german (First of March - de) then it is 3/1/2010 (first of march - us) in the edit field and later it is displayed 3/1/2010 - along with all other rows in the table. If I re-enter the View, the row in question is 3.1.2010 (Third of January - de) - date has been changed.
* If I select by using the DatePicker the field content is german again.
* If I Cancel the edit, the row in question is displayed 3/1/2010 (us) while all other rows are displayed still (de).
* If I navigate to the second page then all rows are displayed in us.
I do not know how to reproduce this in the demos, because the demos. I tried http://demos.telerik.com/aspnet-mvc/grid/localization?culture=de-DE but there is no issue. But how should I find out what the difference is?
0
Accepted
Atanas Korchev
Telerik team
answered on 05 May 2010, 01:53 PM
Hello Frank Michael ,

I suggest you check the example's source code. Also make sure you have checked the help topic which shows how to enable globalization. Probably this is missing in your code.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mario van de Pol
Top achievements
Rank 1
answered on 06 May 2010, 01:27 PM
Hi, I have a similar problem. Checked the online, and my localgrid localization example, it seems to be wrong indeed (choosing German culture): picking say 05.03.2010 will save as 03.05.2010. Picking a day with a higher number than 12 will not update. My problem is actually with datatype double, but I think the source of the problem is the same or related. Validation "says" it expects a "." decimal seperator, while the culture is Dutch so it should expect ",". In the html source code this seems to be correct though: "numericdecimalseparator":",". Now when I fill in a double value 
like 150.95 it will pass clientside validation but save as 0, obviously 
because the system expects 150,95.
0
Frank Michael
Top achievements
Rank 1
answered on 06 May 2010, 06:46 PM
For me the solution was
Html.Telerik().ScriptRegistrar() 
                     .Globalization(true

0
Mario van de Pol
Top achievements
Rank 1
answered on 10 May 2010, 09:32 AM
Thanks for the reply, but unfortunately it didn't work for me. I posted a question on the forum about the Double formatting issue. It is not supported yet...
Tags
Grid
Asked by
Frank Michael
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Frank Michael
Top achievements
Rank 1
Mario van de Pol
Top achievements
Rank 1
Share this question
or