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

Phone number formatting

1 Answer 2384 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrey
Top achievements
Rank 1
Veteran
Andrey asked on 10 Jun 2018, 02:48 PM

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?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 12 Jun 2018, 06:19 AM
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.
Tags
Grid
Asked by
Andrey
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Share this question
or