<script type=”text/javascript”>
function mouseIn(row) {
row.style.backgroundColor = ‘#D3DFF8’;
}
//Function to change color of grid row on mouseout
function mouseOut(row) {
row.style.backgroundColor = ‘#FFFFFF’;
}
</script>

// Use Gridview Row Created Event
protected void GridUsers_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add(“onmouseover”, “mouseIn(this);”);
e.Row.Attributes.Add(“onmouseout”, “mouseOut(this);”);

//It wil add mousein and mouseout jvascript function on every row of gridview

}
}

Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply