using checkbox in telerik grid -


i'm using checkbox in telerik grid. following code

@(html.telerik().grid<productmodel>(model.products.data)                     .name("products-grid")                     .columns(columns =>                     {                         columns.bound(x => x.id)                         .clienttemplate("<input type='checkbox' name='checkedrecords' value='<#= id #>' />")                         .title("")                         .width(36)                         .htmlattributes(new { style = "text-align:center" });                          columns.bound(x => x.id);                         columns.bound(x => x.name);                         columns.bound(x => x.published)                             .width(100)                             .template(x => x.published.tostring().tolower())                             .centered();                      })                     .pageable(settings => settings.total(model.products.total).pagesize(gridpagesize).position(gridpagerposition.both))                     .databinding(databinding => databinding.ajax().select("productreport", "product"))                     .clientevents(events => events.ondatabinding("ondatabinding"))                     .enablecustombinding(true)                     ) 

i see id's in checkbox column instead of checkboxes. can tell me wrong code ??

i checked question , few other dint answer problem..

the problem code definition, defined template in ajax call mode (with clienttemplate method):

.clienttemplate("<input type='checkbox' name='checkedrecords' value='<#= id #>' />") 

but should define server-side template too, template used @ first , direct request:

.template(@<text><input type='checkbox' name='checkedrecords' value='@item.id' /></text>) 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -