This question is locked. New answers and comments are not allowed.
Hey folks,
Got a weird behaviour that I think might be a bug but could just be me!
I have a model with a 'ReceivedDate' property which is used to control the amount of data a grid displays (i.e. show orders after dd/mm/yyyy). The 'ReceivedDate' takes advantage of MVC's culture so automagically displays the correct format, model binding converts the date using the 'CurrentUICulture' in the controller.
Seems to work OK so far, my GET request looks like this:
~/orders?receivedSince=01/09/2011 00:00&ordersGrid-orderBy=DateTime-desc&etc
The issue comes about when sorting (or performing any action) on the grid. The grid appears to consume the model parameters and includes them in the GET request. The grid does not appear to obey the current UI culture for the model property. For example, the entered date is '01/09/2011' which in en-GB is the 1st of September, 2011. When sorting (or some other action) the grid tries to GET:
~/orders?receivedSince=09/01/2011 00:00&ordersGrid-orderBy=DateTime-asc&etc
Which is waaaay back in January; it always puts the month first. Hmm. Any ideas?
FWIW globalization in the web.config is:
<globalization uiCulture="auto" culture="auto" />
Got a weird behaviour that I think might be a bug but could just be me!
I have a model with a 'ReceivedDate' property which is used to control the amount of data a grid displays (i.e. show orders after dd/mm/yyyy). The 'ReceivedDate' takes advantage of MVC's culture so automagically displays the correct format, model binding converts the date using the 'CurrentUICulture' in the controller.
Seems to work OK so far, my GET request looks like this:
~/orders?receivedSince=01/09/2011 00:00&ordersGrid-orderBy=DateTime-desc&etc
The issue comes about when sorting (or performing any action) on the grid. The grid appears to consume the model parameters and includes them in the GET request. The grid does not appear to obey the current UI culture for the model property. For example, the entered date is '01/09/2011' which in en-GB is the 1st of September, 2011. When sorting (or some other action) the grid tries to GET:
~/orders?receivedSince=09/01/2011 00:00&ordersGrid-orderBy=DateTime-asc&etc
Which is waaaay back in January; it always puts the month first. Hmm. Any ideas?
FWIW globalization in the web.config is:
<globalization uiCulture="auto" culture="auto" />
But it doesn't seem to make any difference to the grid. Telerik MVC version is 712, currently the free one (in the process of buying).