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

Column currency changing on view refresh

2 Answers 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
PaulH
Top achievements
Rank 1
PaulH asked on 05 Jun 2019, 02:36 PM

I have an ASP.NET core app I've almost completed and I have an odd issue with a view (razor) that contains 2 Kendo grids. I have the culture set in _layout.cshtml using:

kendo.culture("en-GB");

 

At load of the view all currency columns in both grids correctly show the pound symbol. If I perform an action on the view that causes it to refresh or even if I manually refresh it, every currency value in the grid changes to display a dollar symbol instead. If I click on an item to edit it, which in both cases opens a popup, when I close the popup the grid I opened the popup from has resorted back to showing currency values with a pound symbol. The view itself also contains some kendo numerictextbox fields formatted as c0 or c2 and correctly show the pound symbol both before and after a refresh. Any ideas why the grids might be exhibiting this form of behaviour?

One other things that may be related, but shouldn't be, is I have a bootstrap modal defined in the view which shows a repeat of some of the fields from the main view along with another grid of related data.

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 10 Jun 2019, 12:41 PM
Hello Paul,

The kendo.culture() code should be put in such a place that it is executed each time the page is fully reloaded. If it is inside a block that won't run on reload, for some reason, it is expected that the culture will not be applied. Can you show us the place in _Layout.cshtml where you execute this call and also explain if on reload you are still using the same layout file.

Also, search for any other accidental calls of kendo.culture() inside the page that could be restoring the original culture.

Last, make sure that the kendo.culture.en-GB.min.js file is successfully loaded when you reload the page. If the culture script is missing, calling kendo.culture("en-GB") will have no effect.

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
PaulH
Top achievements
Rank 1
answered on 11 Jun 2019, 08:50 PM

Hi Tsvetina and thanks for your response. I re-evaluated what was going on and although the symptoms were very odd, by re-organising the order in which things are done in the _Layout.cshtml I now seem to have it working consistently. So it appears that it was loading fine on initial load every time but a refresh (via F5) was not consistently setting the culture the same. There was only one call. Either way, it's resolved now.

Thanks again.

Paul.


Tags
Grid
Asked by
PaulH
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
PaulH
Top achievements
Rank 1
Share this question
or