注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 获取当前页面路径,实现权..
 帮助

ASP.NET基础教程-DataGrid表格控件-DataGrid实现双表头


2007-10-11 14:15:16
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://chenxing.blog.51cto.com/240526/45865
private void DataGrid_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
   if(e.Item.ItemType==ListItemType.Header)
   {
      e.Item.Cells[0].ColumnSpan=9;
      e.Item.Cells[0].Font.Bold=true;
      e.Item.Cells[0].Font.Size=24;
      e.Item.Cells[0].HorizontalAlign=HorizontalAlign.Center;
      e.Item.Cells[0].Style.Add("WIDTH","920px");
      e.Item.Cells[0].Text="超耗退库单</td></tr><tr><td Style='WIDTH=68px'>单据类型</td>";
      //e.Item.Cells[1].Style.Add("WIDTH","68px");
     e.Item.Cells[1].Style.Add("WIDTH","160px");
     e.Item.Cells[2].Style.Add("WIDTH","90px");
     e.Item.Cells[3].Style.Add("WIDTH","200px");
     e.Item.Cells[4].Style.Add("WIDTH","50px");
     e.Item.Cells[5].Style.Add("WIDTH","35px");
     e.Item.Cells[6].Style.Add("WIDTH","98px");
     e.Item.Cells[7].Style.Add("WIDTH","120px");
     e.Item.Cells[8].Style.Add("WIDTH","68px");
   }
}
 




    文章评论
 
 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: