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()事件中进行合并.