What is TextBoxFor.Format functionality

2 posts, 1 answers
  1. Dan
    Dan avatar
    167 posts
    Member since:
    Nov 2017

    Posted 15 Oct 2018 Link to this post

    I have an application where jquery validation is used. On a page I have to display some double numbers with formatting. The template used for doubles is the same for all values @Html.Kendo().TextBoxFor(model => model).HtmlAttributes(ViewData).

    I have searched and it seems there is no way to format the number, however I see that the TextBoxBuilder has a property called Format. However this does not do anything.

    What is the point of the property Format?

  2. Answer
    Ivan Danchev
    Admin
    Ivan Danchev avatar
    2027 posts

    Posted 17 Oct 2018 Link to this post

    Hello Dan,

    Thank you for reporting this behavior. We logged it for fixing. Here's the respective issue on our Github repo. 

    There is a way to set the TextBox format initially through HtmlAttributes, e.g.,:
    @Html.Kendo().TextBoxFor(model => model.ProductID).Name("test1").HtmlAttributes(new { @Value = String.Format("{0:C}", Model.ProductID) })

    I updated your Telerik points for reporting this issue.

    Regards,
    Ivan Danchev
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top