Phone number formatting

2 posts, 0 answers
  1. Andrey
    Andrey avatar
    49 posts
    Member since:
    Jul 2014

    Posted 10 Jun 2018 Link to this post

    What is preferable way of the phone number formatting in Kendo UI MVC grid? So far I've found just one way only which is to use UIHint attribute. DataAnnotations on model class level just ignored  ([DisplayFormat(DataFormatString = "{0:###-###-####}", ApplyFormatInEditMode = true)]). Is there any other way like for date formatting?

  2. Stefan
    Admin
    Stefan avatar
    3008 posts

    Posted 12 Jun 2018 Link to this post

    Hello, Andrey,

    The Kendo UI Grid provided a formatting option for its columns to format dates on numbers:

    https://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/GridBoundColumnBuilder#methods-Format(System.String)

    https://docs.telerik.com/kendo-ui/framework/globalization/dateformatting

    https://docs.telerik.com/kendo-ui/framework/globalization/numberformatting

    If this has to be used for editing, a maskedTextBox as the editor could be useful as well:

    https://www.telerik.com/forums/masked-input-for-inline-grid-editing

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top