This is a migrated thread and some comments may be shown as answers.
How to add a class to each row in a grid?
1 Answer 2 Views
This is a migrated thread and some comments may be shown as answers.
Vadym
Top achievements
Rank 1
Vadym asked on 24 Mar 2021, 10:33 AM
Hello everyone. The situation is as follows: I need to add one "draggable" class and one style "cursor: pointer" "to all table rows, but this must be done without using templates, since the styles and content are defined in columns and without loops, because there is too much data and when added by a loop, it hangs.

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 25 Mar 2021, 03:08 PM

Hello Vadym,

Adding a class on the grid rows could be implemented with a loop, but each row will be set only once. Would you please share the grid configuration in order to get a better idea of the overall setup?

The default row template could be changed via the 'rowTemplate' property, where the class could be set. Also, it could be added as an attribute with the "columns.attributes" property, but in this way, it will be applied over each table cell instead of each table row.

In regards to the "cursor: pointer", it could be implemented with CSS, as follows:

<style>
  #grid tr:hover {
     cursor: pointer;
  }
</style>

Looking forward to your feedback.

 

Regards, Mihaela Lukanova Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Vadym
Top achievements
Rank 1
Answers by
Mihaela
Telerik team
Share this question
or