Performing this task used to be simple, but it was my first time dynamically generating the GridView. Each cell in the GridView is styled with its own CSS when created. In the RowDataBound event, I set up the highlighting as usual:
e.Row.Attributes.Add("onmouseover", "this.style.cursor='pointer';HilightRow(this);")
e.Row.Attributes.Add("onmouseout", "HilightRow(this);")
On the scripting side, I have the following:
var curSelRow = null;
function HilightRow(row) {
var selRow = row;
var i;
.
.
if (selRow != null) {
curSelRow = selRow;
curSelRow.style.backgroundColor = '#FFEEC2';
}
}
I have checked the script and it seems to be working fine with no errors. When examining the row in question, it displays the correct background color value (#FFEEC2). However, the hover effect does not change the row's color. This issue is perplexing to me. I am unsure why this is happening because I have done similar tasks many times before without any problems, although those gridviews were not dynamic like this one.