62,251
社区成员
发帖
与我相关
我的任务
分享
protected override void OnRowDataBound(GridViewRowEventArgs e)
e.Row.RowType == DataControlRowType.DataRow//判断行类型为表头
protected override void OnRowDataBound(GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
e.Row.Attributes.Add("style","width:300px;background-color:red;height:30px;");
base.OnRowDataBound(e);
}