How to change background color of the row on click.

I want to change the background color of grid on selection . by default the color on selection is grey but i want to change the background color on selection to green.​ 

i was able to change the hover color to green by using using these lines of code

.e-grid.e-gridhover tr.e-row:hover .e-rowcell:not(.e-cellselectionbackground):not(.e-active):not(.e-updatedtd):not(.e-indentcell){
  background-color: rgb(43, 226, 156) !important;




now i want to change the background color of the grid on selction of row.

1 Reply

MA Mohammed Ansar Sathik Ali Syncfusion Team April 11, 2022 10:19 AM UTC

Hi Abhishek,


Greetings from Syncfusion support.


Query: How to change background color of the row on click.


Based on your query, you need to override the row selected background color and we have achieved your requirement using CSS properties.


Please refer the below code example and sample for more information.


[index.css] 

  // it will override the default row selected background color

  .e-grid td.e-selectionbackground.e-active {

        background-color: blue;

      }


Sample: https://stackblitz.com/edit/react-qzjiaf?file=index.html             


Please get back to us if you need further assistance on this.


Regards,

Mohammed Ansar.


Loader.
Up arrow icon