GridView自动编号与合并表头
来源:互联网 发布:网络和信息安全责任书 编辑:程序博客网 时间:2024/06/05 03:23
//GridView自动编号
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
...{
if (e.Row.RowType == DataControlRowType.DataRow)
...{
e.Row.Cells[0].Text = (e.Row.DataItemIndex + 1).ToString();
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
...{
if (e.Row.RowType == DataControlRowType.DataRow)
...{
e.Row.Cells[0].Text = (e.Row.DataItemIndex + 1).ToString();
}
}
//合并表头
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
...{
switch (e.Row.RowType)
...{
case DataControlRowType.Header:
//第一行表头
TableCellCollection tcHeader = e.Row.Cells;
tcHeader.Clear();
tcHeader.Add(new TableHeaderCell());
tcHeader[0].Attributes.Add("bgcolor", "White");
tcHeader[0].Attributes.Add("colspan", "4"); //跨Column
//tcHeader[0].Attributes.Add("align", "left");
tcHeader[0].Text = "产品列表</th></tr><tr>";
break;
}
}
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
...{
switch (e.Row.RowType)
...{
case DataControlRowType.Header:
//第一行表头
TableCellCollection tcHeader = e.Row.Cells;
tcHeader.Clear();
tcHeader.Add(new TableHeaderCell());
tcHeader[0].Attributes.Add("bgcolor", "White");
tcHeader[0].Attributes.Add("colspan", "4"); //跨Column
//tcHeader[0].Attributes.Add("align", "left");
tcHeader[0].Text = "产品列表</th></tr><tr>";
break;
}
}
- GridView自动编号与合并表头
- GridView合并表头、多重表头
- GridView合并表头多重表头
- GridView合并表头多重表头
- GridView合并表头单元格
- 合并GridView的表头
- GridView多表头合并
- GridView合并单元格表头!
- GridView 表头合并
- gridview 表头合并
- GridView自动编号
- GridView自动编号
- GridView自动编号
- GridView自动编号
- GridView 自动编号
- GridView实现自动编号
- gridview自动编号
- gridview动态生成表头、合并表头
- java程序中IO输入问题
- gSOAP初体验
- ClipboardData兼容
- 常用脚本范例(SQL Server)
- eclipse3.3 CDT4.0 make Error 57的解决方法
- GridView自动编号与合并表头
- 我与TOMCAT不得不说的二三事
- WMI脚本编程实现远程开启3389之新手体验http://blog.tom.com/
- 利用ajax.dll进行Ajax的开发
- dojo学习笔记(一)-dojo.io.IO & dojo.io.BrowserIO)
- 松下传真机清零与维修
- 日期格式转换
- 涙そうそう
- TStringList的一些高级用法