标签:color re c ar type table view css
.table01_singlar
{
background-color: #FFFFFF;
}
.table01_double
{
background-color: #e5eaf0;
}
OnRowDataBound="gvData_RowDataBound"
protected void gvData_RowDataBound(object sender, GridViewRowEventArgs e)
{
//添加样式-----------begin
switch (e.Row.RowType)
{
case DataControlRowType.DataRow:
if (e.Row.RowIndex > -1)
{
// 奇数行
if (e.Row.RowIndex % 2 == 0)
{
e.Row.CssClass = "table01_singlar";
}
else
{
e.Row.CssClass = "table01_double";
}
}
break;
}
//------------------end
}
标签:color re c ar type table view css
原文地址:http://www.cnblogs.com/PeaCode/p/3867803.html