会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
javawebsoa
CnBlogs
Home
New Post
Contact
Admin
GridView合并单元格
//GridView合并单元格 //中间变量,存取TableCell private TableCell publishDateCell = null; protected void grvTest_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //第一行,publishDateCell=null if (publishDateCell == null) { publishDateCell = e.Row.Cells[2]; publishDateCell.RowSpan = 1; } else { //判断当前行的日期是否和publishDateCell一致 //如果一致,跨行 if (e.Row.Cells[2].Text == publishDateCell.Text) { e.Row.Cells[2].Visible = false; publishDateCell.RowSpan++; } else { //如果不等,更新publishDateCell为当前日期 //重新统计跨行 publishDateCell = e.Row.Cells[2]; publishDateCell.RowSpan = 1; } } }
posted @
2011-06-23 12:23
javawebsoa
Views(
190
) Comments(
0
)
Edit
收藏
举报
刷新页面
返回顶部
公告