新微赢技术网
标题:
ASP.NET 2.0中合并GridView 的多表头单元格
[打印本页]
作者:
爱人好难a
时间:
2009-3-16 18:56
标题:
ASP.NET 2.0中合并GridView 的多表头单元格
ASP.NET 2.0中合并GridView 的多表头单元格的代码,包括CSS代码和HTML代码2个部分,发出来给新手学习一下,cs代码:
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
GridViewRow rowHeader = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
//string HeaderBackColor = "#EDEDED";
//rowHeader.BackColor = System.Drawing.ColorTranslator.FromHtml(HeaderBackColor);
rowHeader.BackColor = System.Drawing.Color.Black;
rowHeader.Font.Bold = true;
TableCellCollection cells = e.Row.Cells;
////清除自动生成的表头
//cells.Clear();
TableCell headerCell = new TableCell();
headerCell = new TableCell();
headerCell.Text = "专业";
//headerCell.BorderWidth = Unit.Pixel(0);
//headerCell.BorderStyle = BorderStyle.None;
作者:
朗月星空
时间:
2009-11-2 09:05
一个个全都骑到老大头上来了... 我也来骑一下。
欢迎光临 新微赢技术网 (http://bbs.weiying.cn/)
Powered by Discuz! X3.2