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

Grid Date localisation with .Format fails

1 Answer 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Malcolm
Top achievements
Rank 1
Malcolm asked on 17 Jun 2013, 03:34 PM
Maybe anybody can help me out! I am confused.
I am failing to localize a date column in a grid.
The column is bound the following way in .csthml file:
  
"columns.Bound(o => o.IssueDate).Title(Strings.IssueDate).Format("{0:d}");"

- Session["culture"] is "de-DE"
-.Thread.CurrentCulture/CurrentUICulture is de-DE

But the date ist always displayed in british format. With the old asp.net MVC controls this works fine!

I am using asp.net mvc 4.

What am I doing wrong?

brgds
Malcolm Howlett

1 Answer, 1 is accepted

Sort by
0
Accepted
Malcolm
Top achievements
Rank 1
answered on 18 Jun 2013, 03:17 PM
Ok, I found out myself.
I was missing this in _layout.cshtml

    <script type="text/javascript" language="javascript">
        kendo.culture('@Session["Culture"]');
    </script>
Tags
Grid
Asked by
Malcolm
Top achievements
Rank 1
Answers by
Malcolm
Top achievements
Rank 1
Share this question
or