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 ogridview As GridView = CType(sender, GridView) Dim ogirdviewrow As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert) Dim otablecell As TableCell = New TableCell 'add department otablecell.Text = "Department" otablecell.ColumnSpan = 3 ogirdviewrow.Cells.Add(otablecell) 'add employee otablecell = New TableCell otablecell.Text = "Employee" otablecell.ColumnSpan = 2 ogirdviewrow.Cells.Add(otablecell) ogridview.Controls(0).Controls.AddAt(0, ogirdviewrow) End If End Sub
DotBlogs Tags: ASP.NET posted on 2008/3/20 14:17 | 我要推薦 | 閱讀數 : 372 | 分類[ ASP.NET ] 訂閱