Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had a similar problem with Kendo UI and decimal values. It turned out that the server side was rendering the initial value in the textbox with a comma as decimal separator, because of thread Culture, while Kendo was expecting a period as decimal separator.</p> <p>Make sure that both the Kendo culture and the CurrentCulture on the server side are synchronized.</p> <p>This is what I did to solve the problem I had.</p> <p>On my MVC app's Layout page, after the line where I include the Kendo scripts, I included this snippet:</p> <pre><code>&lt;script&gt; kendo.culture("es-DO"); &lt;/script&gt; </code></pre> <p>On the app's Global.asax.cs file, I included this method that gets executed on every request to the app:</p> <pre><code>protected void Application_BeginRequest(object sender, EventArgs e) { var culture = new CultureInfo("es-DO", false); Thread.CurrentThread.CurrentCulture = culture; Thread.CurrentThread.CurrentUICulture = culture; } </code></pre> <p><strong>edit:</strong> There are several ways to set the culture and UI culture of the application: <a href="http://msdn.microsoft.com/en-us/library/bz9tc508.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bz9tc508.aspx</a>. Moreover, from .NET Framework 4.5 onwards you can set a DefaultThreadCurrentCulture and DefaultThreadCurrentUICulture on initialization.</p> <p>Doing all this will ensure that both the Kendo UI framework and the server use the same separators for thousands and for decimals.</p> <p>Now, this solution works if you only require a single culture on your application. Anyone may feel free to edit this answer to add a multi-culture solution.</p> <p><strong>EDIT:</strong> Telerik themselves have a guide to use the same culture on the server side and the client side: <a href="http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/globalization" rel="nofollow">http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/globalization</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload