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

NumericTextBox with plain digits

1 Answer 637 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 29 Jan 2014, 04:37 PM
Hi.

I would like to render a numerictextbox for an integer field that does not display any thousands separator. 

Which format can be used to render it? I tried using F as shown here: http://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx but Kendo throws an error saying that it's not a supported format.

So what can I do?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 31 Jan 2014, 08:46 AM
Hello Martin,

The thousands separators is displayed due to the currently selected culture, however you could use a custom editor template that overrides the default formatting. For example:  
..
columns.Bound(p => p.MyIntegerField).Width(100).EditorTemplateName("intNumericTextBox");
..
 
 
//The intNumericTextBox.cshtml template:
@model int?
 
@(Html.Kendo().NumericTextBoxFor(m => m)
      .HtmlAttributes(new { style = "width:100%" })
      .Format("#") //more info here
)


Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
NumericTextBox
Asked by
Martin
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or