Uncaught Error: Invalid Template with Kendo Grid in TabStrip

1 Answer 40 Views
Grid TabStrip
Babu
Top achievements
Rank 1
Iron
Iron
Iron
Babu asked on 10 Mar 2025, 09:50 PM

I am encountering an issue while integrating a Kendo Grid within a TabStrip. Whenever I attempt to add the Grid, I receive the attached error(image.png) in the browser console:  Uncaught Error: Invalid template.

Below is the code I am trying to put inside TabStrip. Not sure Please let me know what the mistake I am doing. 

 <div id="divEquipmentDetailsGrid" >
     @(Html.Kendo().Grid<EPP.Core.DTOs.UserEqupmentDetailsDTO>(Model.UserEquipDetails)
                     .Name("EquipmentDetailsGrid")
                     .Columns(columns =>
                     {
                         columns.Bound(p => p.EquipmentName).Title("ss");
                         columns.Bound(p => p.AssertTag).Width(130).Title("tt");
                         columns.Bound(p => p.Accessories).Width(130).Title("rr");
                     })
                 )
 </div>

If I remove the above code I am able to see tabs and data inside the tabs but When I add above code, nothing is displaying and getting error.

 

I am attaching full code cshtml file.

1 Answer, 1 is accepted

Sort by
0
Justin
Telerik team
answered on 13 Mar 2025, 03:32 PM

Hi Babu,

I see you are using an External Client Template to include some complex UI inside the TileLayout

I can point out that there are differences when:

To fix the issue, add the ToClientTemplate() method to the Grid to escape the nested script element the grid creates. 

 <div id="divEquipmentDetailsGrid" >
     @(Html.Kendo().Grid<EPP.Core.DTOs.UserEqupmentDetailsDTO>(Model.UserEquipDetails)
                     .Name("EquipmentDetailsGrid")
                     .Columns(columns =>
                     {
                         columns.Bound(p => p.EquipmentName).Title("ss");
                         columns.Bound(p => p.AssertTag).Width(130).Title("tt");
                         columns.Bound(p => p.Accessories).Width(130).Title("rr");
                     }).ToClientTemplate()
                 )
 </div>

Regards,
Justin
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Tags
Grid TabStrip
Asked by
Babu
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Justin
Telerik team
Share this question
or