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

    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.
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 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
    )


    Regards,
    Alexander Popov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top