I was trying to set the background color on a row based on a certain condition. I managed to do this using the "e.Row.CssClass = HighlightColor;" in the InitializeRow event. In turn my CSS class was like the following..
tbody > tr.LightGreen > td
{
background-color:LightGreen !important;
}
The only problem with this is that the selected row color no longer gets applied to the grid as the setting of the cssClass at TR is taking precedence over the TD settings even thought the TD is getting the correct class. I then tried an alternative approach which was to set the cssClass at the cell level. So my code was something like the following
foreach (GridRecordItem CurrentCell in e.Row.Items)
CurrentCell.CssClass = HighlightColor;
and the following setting was in my CSS
tbody > tr > td.LightGreen
The too sets the background color but i still do not get the selected record color appearing. What combination could i use to get the rowcolor to appear when the row is not selected and obviously the selected color to appear if the row is selected
Regards,
Ray
Prabha,
Thanks for that and of of course its the !important thats the key. Slighly adjusting your solution i put the following into my masterpage
<style type="text/css">
tbody>tr>td.igg_NautilusSelectedCell
background-color:#FF9900 !important;
color:Black;
</style>
Hello Raymond,
You can change selected row color by setting CSS class of selected cell by overriding both background-color and background image as follows:
<ig:Selection RowSelectType="Multiple" CellClickAction="Row" SelectedCellCssClass="rowcolor" >
.rowcolor
background-color:Lime !important;
background-image:none !important;
Please let me know if you have any further questions regarding this matter.
I am using version 13.2