protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#95B8FF'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
e.Row.Attributes["style"] = "Cursor:hand";
}
int count = GridView1.Rows.Count;
string ID = "";
for (int i = 0; i < count; i++)
{
ID =GridView1.DataKeys[i].Value.ToString();
GridView1.Rows[i].Attributes.Add("onclick", "newwin=window.open('要打开的文件?ID=" + ID + "','newwin','width=500,height=550')");
}
}
gridview鼠标经过某行改变样式、颜色并且单击弹出窗口
最新推荐文章于 2021-06-28 18:54:17 发布