62,046
社区成员
发帖
与我相关
我的任务
分享
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string name = e.Row.Cells[0].Text.Trim();
e.Row.Attributes.Add("onclick ", " window.returnValue='" + name + "';window.close();");
if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate)
{
//鼠标经过时,行背景色变
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#E6F5FA'");
//鼠标移出时,行背景色变
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#DEDFDE'");
}
}
}