当前位置:首页 > Web开发 > 正文

GridViewRowEventArgs e) { //鼠标经过改编颜色 if (e.Row.RowType == D

2024-03-31 Web开发

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//鼠标颠末改编颜色
if (e.Row.RowType == DataControlRowType.DataRow)//判定当前的行是否属于datarow类型的行
{

//当鼠标放上去的时候 先生存当前行的配景颜色 并给附一颜色

e.Row.Attributes.Add("onmou搜索引擎优化ver", "currentcolor=this.style.backgroundColor;this.style.backgroundColor=‘yellow‘,this.style.fontWeight=‘‘;");

//当鼠标分开的时候 将配景颜色还原的以前的颜色

e.Row.Attributes.Add("onmou搜索引擎优化ut", "this.style.backgroundColor=currentcolor,this.style.fontWeight=‘‘;");
}


//单击行转变行配景颜色
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "this.style.backgroundColor=‘#99cc00‘; this.style.color=‘buttontext‘;this.style.cursor=‘default‘;");
}
}

Asp.Net中GridView插手鼠标滑过的高亮效果和单击行颜色转变

标签:

原文地点:https://www.cnblogs.com/ljs-13/p/12173184.html

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/31951.html