if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Attributes.Add("style", "vnd.ms-excel.numberformat:@");//文本格式
}
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Attributes.Add("style", "background:#ffffFF;color:#000000;font-size:14px;");//表头格式,也就是显示字段名称的那一行
}
else
{
// e.Row.Attributes.Add("style", "background:#FFF");
}
本文介绍了如何使用ASP.NET中GridView控件的RowDataBound事件来设置不同行的样式,包括数据行的文本格式及表头的背景颜色、字体大小等属性。
215

被折叠的 条评论
为什么被折叠?



