Protected Sub ReportGridView_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.DataBound
Dim ExtraTable As Table = GridView1.Controls(0)
Dim ExtraGridViewRow As New GridViewRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal)
Dim ExtraTableHeaderCell1 As New TableHeaderCell
ExtraTableHeaderCell1.Text = "First 2 Columns"
ExtraTableHeaderCell1.ColumnSpan = 2
ExtraGridViewRow.Cells.Add(ExtraTableHeaderCell1)
Dim ExtraTableHeaderCell2 As New TableHeaderCell
ExtraTableHeaderCell2.Text = "Next 3 Columns"
ExtraTableHeaderCell2.ColumnSpan = 3
ExtraGridViewRow.Cells.Add(ExtraTableHeaderCell2)
Dim ExtraTableHeaderCell3 As New TableHeaderCell
ExtraTableHeaderCell3.Text = "Last 4 Columns"
ExtraTableHeaderCell3.ColumnSpan = 4
ExtraGridViewRow.Cells.Add(ExtraTableHeaderCell3)
End Sub
Tips and tricks for .NET using ASP and VB code.
Add a header to a gridview that groups some columns
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment