i\'m trying to add a new headerrow to a Gridview. This row should appear below the original headerrow.
As far as I know I have two events to choose from:
1.)
Try this when you add the row to the InnerTable:
t.Controls.AddAt(1, r)
Here's a quick basic test I did, which seems to work OK:
Protected Sub gridview_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles gridview.DataBound
Dim g As GridView = CType(sender, GridView)
Dim r As New GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal)
Dim th As New TableHeaderCell()
th.ColumnSpan = g.Columns.Count
th.Text = "This is my new header"
r.Cells.Add(th)
Dim t As Table = CType(g.Controls(0), Table)
t.Rows.AddAt(1, r)
End Sub