background color of a selected row

Hi,

Can anyone tell me how to change the background color for a selected row?
As you can see below, by default it shows me two different background colors!

thx


You may try to disable background image for the selected row:

div.gridbox_dhx_skyblue table.obj.row20px tr.rowselected td{ background-image: none; }

Hello everyone,

I need to change the background of a selected row only when the mouse is over it.
I’ve tried this code sample, but whithout success :

this._grid.attachEvent(“onMouseOver”, function(id,ind){
var selectedRows = localthis._grid.getSelectedId();
if(selectedRows){
var idArray = selectedRows.split(",");
for(var i = 0 ; i < idArray.length ; i++) {
if(id == idArray[i]){
localthis._grid.setRowTextStyle(id, “background-color: #FFC993;”);
}
}
});

localthis object designs my grid.

Could somebody help me ?
Thx.

You can use

grid.enableRowsHover(true, “myhover”);

and define css as

.myhover{ background:red !important; }

Because of !important flag such rule will override selection color.

Hi Stanislav,

Thx for the answer.
I’m already using the enableRowsHover method, and it works perfectly. So, when the mouse is over a row, the background is modified.

What I really need is : When a row is selected, a specific background is fixed. This background need to be changed when the mouse is over.

Let me know if you need more information in order to help me.

To be more specific

I have three colors :

  • one color for the mouseOver (used in the enableRowHover method) -> OK
  • one color used to set the background of the selected rows -> OK
  • one color used to change the background of a selected row when the mouse is over it -> KO

I’m stucked with this third color, I don’t know how to implement it. That’s why I tried something whith the sample I posted earlier (the onMouseOver event).

Any idea ?
Thx

Just use

<style> .myhover { background:green; } .rowselected .myhover { background:red !important; } </style>

I need to disable the background image for the selected row. Or more specifically, my columns have a white background for an editable column and a grey background for a non-editable column. I want this to NOT change upon selecting the row.

I see the following solution in this forum, but I have not been able to make this work.

div.gridbox_dhx_skyblue table.obj.row20px tr.rowselected td{ background-image: none; }

Any ideas?

Unfortunately such feature is not available.
You may try to use the marker selection:
dhtmlx.com/docs/products/dht … rkers.html