国债利率表2012,陈云子女,九游战歌网
datagrid中
首先我们假设.x文件中datagrid的数据行的样式为
<alternatingitemstyle backcolor="white" forecolor="#284775" />
<itemstyle backcolor="#f7f6f3" forecolor="#333333" />则在datagrid的itemdatabound事件中添加如下代码即可
if (e.item.itemtype == listitemtype.item || e.item.itemtype == listitemtype.alternatingitem)
{
e.item.attributes["onclick"] = "javascript:c=this.style.backgroundcolor;this.style.background='#ffa500';"; //current 粉蓝色 //--#6699ff 蓝色 #ffff00 黄色 #ffffe0 亮黄色
if (e.item.itemtype == listitemtype.item)
{
e.item.attributes["ondblclick"] = "javascript:this.style.background='#f7f6f3';";
}
else
{
e.item.attributes["ondblclick"] = "javascript:this.style.background='#ffffff';";
}
}
gridview中
首先我们假设.aspx文件中gridview的数据行的样式为
<alternatingrowstyle backcolor="white" forecolor="#284775" />
<rowstyle backcolor="#f7f6f3" forecolor="#333333"/>则在gridview的rowdatabound事件中添加如下代码即可
if (e.row.rowtype == datacontrolrowtype.datarow)
{
e.row.attributes["onclick"] = "javascript:c=this.style.backgroundcolor;this.style.background='#ffa500';";
if (e.row.rowstate == datacontrolrowstate.normal)
{
e.row.attributes["ondblclick"] = "javascript:this.style.background='#f7f6f3';";
}
if (e.row.rowstate == datacontrolrowstate.alternate)
{
e.row.attributes["ondblclick"] = "javascript:this.style.background='white';";
}
}
摘自 爱智旮旯
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论