Posts tagged: onmouseout

Mar 02 2010

Gridview Row MouseOver and MouseOut

<script language=”javascript” type=”text/javascript”>

var oldgridSelectedColor;

function setMouseOverColor(element)

{

oldgridSelectedColor = element.style.backgroundColor;

element.style.backgroundColor=’yellow’;

element.style.cursor=’hand’;

element.style.textDecoration=’underline’;

}

function setMouseOutColor(element)

{

element.style.backgroundColor=oldgridSelectedColor;

element.style.textDecoration=’none’;

}

</script>

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)

{

if (e.Row.RowType == DataControlRowType.DataRow)

{

e.Row.Attributes["onmouseover"] =”javascript:setMouseOverColor(this);”;

e.Row.Attributes["onmouseout"] =”javascript:setMouseOutColor(this);”;

}

}

Alibi3col theme by Themocracy