c# - Partial View in kendo grid column -
i have ajax enabled kendo grid client template displays data model row bound. (because of ajax, using columns.template seems not possible.)
@(html.kendo().grid<model>() .columns(columns => { columns.bound(x => x.submodel).clienttemplate("bla #= somepropertyofsubmodel # bla") }) .datasource(datasource => datasource.ajax())
this works basically, not satisfied result. ex., have problems make kendo controls in template work. rather hang partial view in client template, did not succeed. farthest got was
columns.bound(x => x.submodel).clienttemplate(html.partialview("view", //??) //how bind submodel? .tohtmlstring())
any appreciated.
i think need .toclienttemplate()
in kendo control template,
view.cshtml
@(html.kendo().numerictextbox() .name("namehere") .min(0) .htmlattributes(new { style = "width:200px" }) .toclienttemplate() )
and then,
columns.bound(c => c.submodel).clienttemplate(html.partial("view").tohtmlstring());
edit:
if want bind model partial view, do
columns.bound(c => c.submodel.property).template(@<text>html.partial("view", item.submodel)</text>);
Comments
Post a Comment