gridview中将header的多列合并为一列
2007-03-30 21:21
204 查看
Protected Sub GridView1_RowCreated(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) _
Handles GridView1.RowCreated
If e.Row.RowType = DataControlRowType.Header Then
Dim oCell As New TableCell
oCell.ColumnSpan = e.Row.Cells.Count
e.Row.Cells.Clear()
oCell.Text = "Merged header"
e.Row.Cells.Add(oCell)
End If
End Sub
当然也可以在GridView_DataBound()事件中进行合并.
ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) _
Handles GridView1.RowCreated
If e.Row.RowType = DataControlRowType.Header Then
Dim oCell As New TableCell
oCell.ColumnSpan = e.Row.Cells.Count
e.Row.Cells.Clear()
oCell.Text = "Merged header"
e.Row.Cells.Add(oCell)
End If
End Sub
当然也可以在GridView_DataBound()事件中进行合并.
相关文章推荐
- pig中将两列合并为一列:concat
- gridview合并同一列相同内容的单元格
- 合并Gridview中的一列相同数据的行
- 动态合并或定制GridView控件Header头某些列
- pig中将两列合并为一列:concat
- 在MS SQL中将表中多行数据合并成一列数据
- 动态合并或定制GridView控件Header头某些列
- 在数据库中将字表中的多行合并到一列中
- 在数据库中将字表中的多行合并到一列中
- GridView-合并header与datarow单元格
- 向GridView动态增加一列,DropDownList控件及Header
- GridView合并多行列值
- SQL server中将一个表中一列数据更新到另一个表中
- SQL查询两列合并一列
- 不修改 GridView的HeaderText,其中数据库中的头标题是:custName,custId.这样的字符同样显示在GridView中,应该如何更改才能让GridView的头一行显示:姓名,编号而不是显示custName,custId
- ASP.Net2.0控件-GridView(合并表头单元格)
- 合并 GridView 的表头单元格
- 应用场景:将项目组的员工职位合并到同一列
- 【转】gridview合并列
- webapi下使用npoi导出数据到excel,包含自动列宽和自动合并某一列单元格