Hi,
Can anyone help me for merge Header column in gridview?
Thanks In Advance,
Jitendra Patel
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jitendra PatelPosted Apr 8, 2011, 7:24 AM
I have also got the soluation.
In grid rowdatabound event write code,
which row you have to merge start it's loop to end columns..
If e.Row.RowType = DataControlRowType.Header Then
Dim dg As GridView = grvReviewDetails
Dim tb As Table = dg.Controls(0)
Dim tr As GridViewRow
Dim j As Integer
tr = tb.Rows(tb.Rows.Count - 1)
tr.Cells(2).ColumnSpan = 4
For j = 3 To 6
tr.Cells(j).Visible = False
tr.Cells(2).Visible = True
tr.Cells(2).Text = "Rating"
tr.Cells(2).HorizontalAlign = HorizontalAlign.Center
Next
tr.Cells(6).Visible = True
tr.Cells(6).Text = "Remarks"
End If
It's work perfectly.
Again thanks for your replay,
Keep it up,
saravanan subramanianPosted Apr 8, 2011, 6:30 AM
try this link:
http://shawpnendu.blogspot.com/2010/01/merge-merging-or-split-spliting.html
Regard
Saravanan.s
piyush sardharaPosted Apr 8, 2011, 5:42 AM
Finally write the following code in the RowCreated event
C#
piyush sardharaPosted Apr 8, 2011, 5:41 AM
that see get answer