Child Table ClientTemplate Data Bind Issue

1 Answer 26 Views
Checkbox TabStrip
Kosi
Top achievements
Rank 1
Kosi asked on 02 Dec 2024, 01:09 PM

https://demos.telerik.com/aspnet-core/grid/hierarchy?_gl=1*j684iw*_gcl_au*NzkwOTcxNzM0LjE3MzI2ODQyMjI.*_ga*NDI2MDIyNDE3LjE3MDM2NjI4NTM.*_ga_9JSNBCSF54*MTczMzEyMTgzOC42LjEuMTczMzEyNzMwNy40Ny4wLjA.

 

I have build my parent child table grid by referring above link. Still i need to have check box for each row just like checkbox tree. 

For that i need to bind my child row id in template, I tried as below. 

columns.Bound(o => o.ChildAppointmentID).Width(50).ClientTemplate("#= childCheckbox(OrderId) #");

Issue is:

At runtime, it is trowing error from child table by saying that it can not bind "OrderId" (No order id is not found).

Further i found out, This template only able to bind the date from parent data source only.

 

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 02 Dec 2024, 03:13 PM

Hi Kosi,

 

You can achieve this requirement like this:

columns.Bound(o => o.ChildAppointmentID).Width(50).ClientTemplate(" childCheckbox('#=YourFieldName#;)");

When using evaluations inside the Inner Grid's templates, you will need to escape the hashes like this: `\\#` or `\\\\#`:
https://docs.telerik.com/kendo-ui/framework/templates/essentials#using-hash-literals

Can you try these suggestions and let me know if you find my answer helpful?

 

Regards,
Eyup
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Checkbox TabStrip
Asked by
Kosi
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or