whiwex
asked on
How to you change a gridview rows background color for chrome
I am using vb.net.
I have a gridview with a checkbox in column 0. When the checkbox is selected it fires a script that changes the background color of the row. It works fine in internet explore but not in chrome. I set the checkboxes onclick in the gridview's rowdatabound event. Here is my script code
<script type="text/javascript">
//variable that will store the current color of the selected row
var RowColor;
function ChangeRowColor(row) {
//get the color of the selecte row
RowColor = document.getElementById(ro w).current Style.back groundColo r;
// if current color is white then change it to blue
if (RowColor == "#ffffff") {
// change the color to blue
document.getElementById(ro w).style.b ackgroundC olor = "#3399FF";
}
// if current color is white then change it to blue
else if (RowColor == "white") {
document.getElementById(ro w).style.b ackgroundC olor = "#3399FF";
}
else
// current color is blue then change it to white
{
document.getElementById(ro w).style.b ackgroundC olor = "#ffffff";
}
}
</script>
How do I get this to work in chrome?
I have a gridview with a checkbox in column 0. When the checkbox is selected it fires a script that changes the background color of the row. It works fine in internet explore but not in chrome. I set the checkboxes onclick in the gridview's rowdatabound event. Here is my script code
<script type="text/javascript">
//variable that will store the current color of the selected row
var RowColor;
function ChangeRowColor(row) {
//get the color of the selecte row
RowColor = document.getElementById(ro
// if current color is white then change it to blue
if (RowColor == "#ffffff") {
// change the color to blue
document.getElementById(ro
}
// if current color is white then change it to blue
else if (RowColor == "white") {
document.getElementById(ro
}
else
// current color is blue then change it to white
{
document.getElementById(ro
}
}
</script>
How do I get this to work in chrome?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.