我在GridView1_RowDataBound(object sender, GridViewRowEventArgs e)中加了
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='yellow'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");
但是鼠标经过没有效果,请问是为什么?
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='yellow'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");
但是鼠标经过没有效果,请问是为什么?
e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor=c");注意大小写区分
{
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#B7E3FE'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
}
e.Row.Attributes.Add("onmouseout", "this.style.currentcolor=this.style.backgroundColor; this.style.backgroundColor='';");
function changeRowColor( row,girdview)
{
var GridView = document.getElementById(girdview);
if(GridView!=null)
{
//GridView.rows[1].className ="RowStyle";
for(i = 1;i < GridView.rows.length-1; i++)
{
if(i==row+1)
{
GridView.rows[i].className ="SelectedRowStyle";
}
else
{
if(i%2==0)
{
GridView.rows[i].className ="RowStyleNo";
}
else
{
GridView.rows[i].className ="RowStyle";
}
}
}
}
else
{
return false;
}
}