kendo ui - Can i create KendoUI controls in my Controller -
can create kendoui asp.net mvc wrapper controls in controller class , pass them on views. , can display them there on views.
for example:
public actionresult index() { gridbuilder<customerviewmodel> grid = new gridbuilder<customerviewmodel>(new grid<customerviewmodel>( new viewcontext(), // <-- view empty di.current.resolve<ijavascriptinitializer>(), di.current.resolve<iurlgenerator>(), di.current.resolve<igridhtmlbuilderfactory>())); viewbag.g = grid; homecoming view(); }
you create method uses kendo gridbuilder type:
public static kendo.mvc.ui.fluent.gridbuilder<t> rendergrid<t>(this htmlhelper helper, string gridname) t : yourobject { homecoming helper.kendo().grid<t>().do stuff here;
}
and phone call in razor markup:
@rendergrid("gridname")
kendo-ui kendo-asp.net-mvc
No comments:
Post a Comment