Decimal Seperator on Grid Cell

3 posts, 0 answers
  1. Kursad Nebi
    Kursad Nebi avatar
    2 posts
    Member since:
    Mar 2016

    Posted 29 Mar 2016 Link to this post

    Decimal separator changes comma to dot when focused to update cell. see in attached images.





    columns.Bound(p => p.ALIS_FIYATI).Width(220).Format("{0:n2}"); 


        <script src="@Url.Content("~/Scripts/kendo/cultures/")"></script>


  2. Dimiter Topalov
    Dimiter Topalov avatar
    1298 posts

    Posted 01 Apr 2016 Link to this post

    Hello Kursad,

    The described undesired behavior is caused by the fact that there is no default Editor Template set for the corresponding data type, and therefore the value is opened for editing in a regular textbox. The default JavaScript decimal separator is a dot ('.').

    To apply the custom Kendo Culture settings while editing, you have to create a default Editor Template for the decimal (or double) type, so that the corresponding values will be opened in a Kendo UI NumericTextBox and the correct culture settings will be applied. For example:

    // Grid Configuration
    columns.Bound(p => p.ALIS_FIYATI).Width(220).Format("{0:n2}").EditorTemplateName("Decimal");
    // Decimal.cshtml file in Views/Shared/EditorTemplates
    @model decimal
    @(Html.Kendo().NumericTextBoxFor(m => m)
          .HtmlAttributes(new { style = "width:100%" })

    You can find more information about Editor Templates in the following section of our documentation:

    I hope this helps.

    Dimiter Topalov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kursad Nebi
    Kursad Nebi avatar
    2 posts
    Member since:
    Mar 2016

    Posted 01 Apr 2016 in reply to Dimiter Topalov Link to this post


    Thank you.

Back to Top