Default Grid template for cells

1 Answer 72 Views
Grid GridLayout
Dennis
Top achievements
Rank 1
Dennis asked on 19 May 2023, 10:47 AM | edited on 19 May 2023, 11:42 AM

Hello,

I need to apply the default template to all cells without template in all grids throughout the existing application, for example:

<span class="some-css-class">FieldValue</span>

Is there a way to achieve this?

Thanks,

Dennis

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 24 May 2023, 09:20 AM

Hi Dennis,

 

Thank you for contacting us.

The only way to achieve this requirement is to apply a global javascript on all of the pages which contain a Grid component.

You can do that by leveraging the .Events(e=>e.DataBound("handlerName")) event handler:
https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/databound

And then iterating through the items to insert this template:
https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/items

This can happen using the append or appendTo jQuery methods:
http://api.jquery.com/appendto/

Let me know what you think about this idea. Do you like it?

 

Regards,
Eyup
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.

Tags
Grid GridLayout
Asked by
Dennis
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or