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

Decimal Seperator on Grid Cell

2 Answers 302 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kursad Nebi
Top achievements
Rank 1
Kursad Nebi asked on 29 Mar 2016, 06:24 PM

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

 

Notes:

GridEditMode.InCell

------------

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

-------------

    <script src="@Url.Content("~/Scripts/kendo/cultures/kendo.culture.tr-TR.min.js")"></script>
    <script>
        kendo.culture("tr-TR");
    </script>

 

2 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 01 Apr 2016, 07:34 AM
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:

http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/editor-templates#editor-templates

I hope this helps.

Regards,
Dimiter Topalov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kursad Nebi
Top achievements
Rank 1
answered on 01 Apr 2016, 09:28 AM

Great!

Thank you.

Tags
Grid
Asked by
Kursad Nebi
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Kursad Nebi
Top achievements
Rank 1
Share this question
or