Is there a way to dynamically bind a kendo grid control and also use custom templates for each? I can only find examples for binding a datatable page model, but the datasource must be flat. Any ideas on how to conduct dynamic binding with flat (or otherwise) display template?
0
votes
1 Answers
0
votes
Not sure what you mean... "use custom templates for each" what? The templates are in a DB or something?
Maybe you can extend this example:
Kendo UI dynamic grid creation with columns ordering grouping and paging/
...by adding another dictionary in the model that describes, with some rules, which template to use each time and using in column creation like this:
.Columns( columns => {
foreach ( var c in Model.Bind )
columns.Bound( c.Value, c.Key ).Template( Model.Templates.Where( t => t.key == c.Key).FirstOrDefault() );
} )