This example shows the in-line data editing feature of Telerik Grid for ASP.NET MVC. In this example the grid is using web service binding.
To enable editing you need perform the following:
<%= Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(c => c.ContactName).Width(360);
columns.Bound(c => c.Country).Width(120);
columns.Bound(c => c.Address).Width(200);
columns.Bound(c => c.BirthDay).Width(130).Format("{0:d}");
columns.Command(commands =>
{
commands.Edit();
commands.Delete();
}).Width(200);
})
%>
<%= Html.Telerik().Grid(Model)
.Name("Grid")
.ToolBar(commands => commands.Insert())
.Columns(columns =>
{
//omitted for brevity
})
%>
<%= Html.Telerik().Grid(Model)
.Name("Grid")
.ToolBar(commands => commands.Insert())
.DataKeys(keys => keys.Add(c => c.CustomerID))
.Columns(columns =>
{
//omitted for brevity
})
<%= Html.Telerik().Grid(Model)
.Name("Grid")
.ToolBar(commands => commands.Insert())
.DataKeys(keys => keys.Add(c => c.CustomerID))
.DataBinding(dataBinding => dataBinding
.WebService()
.Select("~/Models/Customers.asmx/GetCustomers")
.Update("~/Models/Customers.asmx/SaveCustomer")
.Insert("~/Models/Customers.asmx/InsertCustomer")
.Delete("~/Models/Customers.asmx/DeleteCustomer")
)
.Columns(columns =>
{
//omitted for brevity
})