We would like to use incell editing and a masked phone no. MVC 5 application
I have tried this:
telephone.cshtml
Model
gridview.cshtml
However, this does not work :(
Please help
I have tried this:
telephone.cshtml
@using Kendo.Mvc.UI@model string@(Html.Kendo().MaskedTextBoxFor(m=>m).Mask("(000) 000-0000"))Model
public class ResidentVm { public Guid ResidentId { get; set; } [Required] public string FirstName { get; set; } [Required] public string LastName { get; set; } [Required] [DataType(DataType.EmailAddress)] public string Email { get; set; } [Required] [DataType(DataType.PhoneNumber)] [UIHint("Telephone")] public string Phone { get; set; } [Display(Name = "DOB")] [Required] [UIHint("Date")] public DateTime DOB { get; set; } }gridview.cshtml
@(Html.Kendo().Grid<ResidentVm>() .Name("ResidentsGrid") .Columns(c => { c.Bound(r => r.ResidentId).Hidden(); c.Bound(r => r.FirstName); c.Bound(r => r.LastName); c.Bound(r => r.Phone).EditorTemplateName("telephone"); c.Bound(r => r.Email); c.Bound(r => r.DOB).Format("{0:d}").EditorTemplateName("Date"); }) .Editable(editable => editable.Mode(GridEditMode.InCell)) .ToolBar(toolBar => toolBar.Create()) .Pageable() .Sortable() .Scrollable() .HtmlAttributes(new { style = "height:230px; margin-bottom:20px" }) .DataSource(dataSource => dataSource .Ajax() .Batch(true) .ServerOperation(false) .PageSize(20) .Events(events => events.Error("error_handler")) .Model(m => { m.Id(em => em.ResidentId); m.Field(p => p.ResidentId).Editable(false); }) .Create(update => update.Action("CreateResidents", "AuthorizationExemption")) .Read(read => read.Action("GetResidents", "AuthorizationExemption")) .Update(update => update.Action("EditingInline_Update", "AuthorizationExemption")) .Destroy(update => update.Action("EditingInline_Destroy", "AuthorizationExemption")) ) )However, this does not work :(
Please help