a) (http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx)
my code will be be like this
on controller.cs
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
var tme = new db_TestEntities();
ViewData["tb_TestMvc"] = tme.tb_TestMvc.ToList();
return View();
}
on index.cshtml ity will be like this
@(Html.Telerik().Grid<TelerikMvcApplication1.Models.tb_TestMvc>()
.BindTo((List<TelerikMvcApplication1.Models.tb_TestMvc>)ViewData["tb_TestMvc"])
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Id).Width(210);
columns.Bound(p => p.ContactTitle).Width(130).Format("{0:c}");
columns.Bound(p => p.ContactName).Width(130).Format("{0:N}");
columns.Bound(p => p.Country).Width(130).Format("{0:d}");
columns.Command(commands => commands.Edit()).Title("Edit");
})
.Sortable()
.Pageable()
)