telerik grid - Make only one column editable -
my goal make grid checkbox (isactive
) editable , should editable without having press edit button. checkbox bound model, instead of making manual checkbox , handle changes myself.
the result should this: http://demos.telerik.com/aspnet-mvc/razor/grid/headerfootertemplates
model
public class mymodel { public int id { get; set; } public string name { get; set; } public bool isactive { get; set; } }
view
html.telerik().grid(model) .name("grid") .columns(column => { column.bound(x => x.id); column.bound(x => x.name); column.bound(x => x.isactive) .headertemplate(@<text>@html.checkbox("checkall")</text>); }) .enablecustombinding(true) .databinding(databinding => databinding.server().select("index", "stuff")) .render();
is possible?
using template
seems option.
i switched ajax binding i'm using clienttemplate
column.bound(x => x.isactive) .clienttemplate("<input type=\"checkbox\" name=\"checkedrecords\" value=\"<#= id #>\" <#= isactive ? \"checked='checked'\" : '' #> />") .headertemplate(@<text>@html.checkbox("checkall")</text>);
now need figure out how bind checkbox click command.update()
.
Comments
Post a Comment