Below is my Grid, I am trying to add zip codes to the grid. When I click on Add New Zip Code, I am getting textbox inline. I want to validate that zip Code. User can enter 55555 or 55555-1111. How can I do this ?
@(Html.Kendo().Grid(Model)
.Name("ZipGrid")
.HtmlAttributes(new { @class = "GridStyle" })
.Columns(columns =>
{
columns.Bound(p => p.Id).Hidden();
columns.Bound(p => p.ZipCode).Width(250);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.ToolBar(toolBar =>
{
toolBar.Create().Text("Add Zip Code");
})
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("onError"))
.Model(model => model.Id(p => p.Id))
.Create(create => create.Action("AddZipCode", "Manage"))
.Read(read => read.Action("GetZipCode", "Manage"))
.Update(update => update.Action("UpdateZipCode", "Manage"))
.Destroy(Destroy => Destroy.Action("AddZipCode", "Manage")).ServerOperation(false)
)
)
@(Html.Kendo().Grid(Model)
.Name("ZipGrid")
.HtmlAttributes(new { @class = "GridStyle" })
.Columns(columns =>
{
columns.Bound(p => p.Id).Hidden();
columns.Bound(p => p.ZipCode).Width(250);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.ToolBar(toolBar =>
{
toolBar.Create().Text("Add Zip Code");
})
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("onError"))
.Model(model => model.Id(p => p.Id))
.Create(create => create.Action("AddZipCode", "Manage"))
.Read(read => read.Action("GetZipCode", "Manage"))
.Update(update => update.Action("UpdateZipCode", "Manage"))
.Destroy(Destroy => Destroy.Action("AddZipCode", "Manage")).ServerOperation(false)
)
)