Hi all,\
I have one problem. I already add header at gridview. but the header start at column 0. How I want to change the header start from column 2? Here is my code. Please help.
Protected Sub GridView1_RowCreated(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
If e.Row.RowType = DataControlRowType.Header Then
Dim header As GridView = CType(sender, GridView)
Dim gvr As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert)
Dim tCell As New TableCell()
tCell.Text = "DAILY OPERATION HOURS"
tCell.HorizontalAlign = HorizontalAlign.Center
tCell.BackColor = Drawing.Color.Black
tCell.ColumnSpan = 24
gvr.Cells.Add(tCell)
GridView1.Controls(0).Controls.AddAt(0, gvr)
End If
End Sub
try changing of postion in this line and check once
Dim gvr As New GridViewRow(0, 1, DataControlRowType.Header, DataControlRowState.Insert)
沒有留言:
張貼留言