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

Item values in template

3 Answers 190 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 22 Nov 2018, 12:57 PM

To access item values in a template you should, as I understand it, use a construct like:

.Columns(factory => factory.Template(@<text><img title="@item.Receiver" src="/image/information.png"/></text>)

but when doing this I get the compilation error "Cannot convert lambda expression to type 'string' because it is not a delegate type".

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 26 Nov 2018, 10:05 AM
Hi Rob,

You can use something like this to achieve this requirement:
.Columns(columns =>
{
    columns.Bound(c => c.Price).ClientTemplate("<img title='#= data.Price #' src='/image/information.png'/>");

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Rob
Top achievements
Rank 1
answered on 27 Nov 2018, 02:56 PM

I could, but it's so much more convenient to work with server side code.
Any special reason why the method taking a lambda expression isn't present in the Core version of the framework, as it is in the regular ASP.NET version?

0
Eyup
Telerik team
answered on 29 Nov 2018, 02:35 PM
Hello Rob,

With the Core version, the Template is not rendered on the server as mentioned here:
https://www.telerik.com/forums/kendo-menu-in-clienttemplate-not-working#963HosE6nUaANESzUBFWxA

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Rob
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Rob
Top achievements
Rank 1
Share this question
or