实例讲解动态加载gridview中的行及其样式
程序员文章站
2024-02-27 15:36:33
知识点及实例 复制代码 代码如下: protected void gvsuperadminseeinfo_rowdatabound(object sender, gridv...
知识点及实例
protected void gvsuperadminseeinfo_rowdatabound(object sender, gridviewroweventargs e)
{
if (e.row.rowtype != datacontrolrowtype.datarow)//判断是否是数据行
{
return;
}
e.row.attributes.add("onmouseover", "this.style.backgroundcolor='#ffffcf'");
if (e.row.rowindex % 2 == 0)
{
e.row.cssclass = "gvsuperadminseeinfoorow";
e.row.attributes.add("onmouseout", "this.style.backgroundcolor='#fff'");
}
else
{
e.row.cssclass = "gvsuperadminseeinfojrow";
e.row.attributes.add("onmouseout", "this.style.backgroundcolor='#f5f5f5'");
}
}
复制代码 代码如下:
protected void gvsuperadminseeinfo_rowdatabound(object sender, gridviewroweventargs e)
{
if (e.row.rowtype != datacontrolrowtype.datarow)//判断是否是数据行
{
return;
}
e.row.attributes.add("onmouseover", "this.style.backgroundcolor='#ffffcf'");
if (e.row.rowindex % 2 == 0)
{
e.row.cssclass = "gvsuperadminseeinfoorow";
e.row.attributes.add("onmouseout", "this.style.backgroundcolor='#fff'");
}
else
{
e.row.cssclass = "gvsuperadminseeinfojrow";
e.row.attributes.add("onmouseout", "this.style.backgroundcolor='#f5f5f5'");
}
}
上一篇: 详解Java 中程序内存的分析
下一篇: centos mysql 修改数据库目录