NumericTextBox with plain digits

2 posts, 0 answers
  1. Martin
    Martin avatar
    1 posts
    Member since:
    Jul 2013

    Posted 29 Jan 2014 Link to this post


    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: but Kendo throws an error saying that it's not a supported format.

    So what can I do?

  2. Alexander Popov
    Alexander Popov avatar
    1436 posts

    Posted 31 Jan 2014 Link to this post

    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

    Alexander Popov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top