This is a migrated thread and some comments may be shown as answers.

Template for list of complex objects

1 Answer 354 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 11 Jul 2016, 06:59 PM

I have a several columns bound to a list of objects.

 

What's the simplest way to define a re-usable ClientTemplate using razor?

Something like this?

column.Bound(e => e.MyList).ClientTemplate(Html.Partial("MyPartialView", "#=MyList#").ToHtmlString());  //doesn't compile

Where MyPartialView uses MyList as the model for its page?

 

Thanks

 

 

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 14 Jul 2016, 06:33 AM

Hello Marc,

 

The Html.Partial should be handled on the server (server-side code), but the "#" syntax is part of the client-side templates (please refer to the Templates Overview article). The provided code will not work because the "#" syntax will not be evaluated on the server (it will be evaluated on the client-side). 

 

Please refer to the Partial View in kendo grid column, where same question is discussed. 

 

Regards,
Boyan Dimitrov
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
Marc
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or