Grid - Disable row hover color change

1 Answer 520 Views
Grid
Mike
Top achievements
Rank 1
Mike asked on 17 Jan 2024, 06:06 PM
How can I stop the background color of a row changing when you hover over it?

1 Answer, 1 is accepted

Sort by
0
Hetali
Telerik team
answered on 17 Jan 2024, 09:50 PM

Hi Mike,

To prevent the background color of the Kendo UI Grid row changing on hover, set the background color to the color displayed when it's not hovered over. For example:

.k-grid .k-table-row:hover,
.k-grid .k-table-tbody > .k-table-row:not(.k-detail-row):hover {
  background-color: rgba(0, 0, 0, 0); 
}
        
.k-grid .k-table-row.k-table-alt-row:hover,
.k-grid .k-table-tbody > .k-table-row.k-table-alt-row:not(.k-detail-row):hover {
  background-color: rgba(0, 0, 0, 0.04);
}

In this StackBlitz example, the background color of the Grid row remains the same on hover. Please make sure to set the encapsulation to ViewEncapsulation.None to apply the style locally.

I hope this helps. Let me know if I can further assist you.

Regards,
Hetali
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Hetali
Telerik team
Share this question
or