Reputation: 3891
How can I achieve the following format in gridview
Upvotes: 1
Views: 7827
Reputation: 21
I had the same problem, this is the solution that I found. this is in VB
Protected Sub GridV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GridV.RowDataBound
If (e.Row.RowType = DataControlRowType.DataRow) Then
'Here put the condition
If e.Row.Cells(3).Text = "0" Then
e.Row.Cells(1).ColumnSpan = 4
e.Row.Cells(2).Visible = False
e.Row.Cells(3).Visible = False
e.Row.Cells(4).Visible = False
End If
End If
End Sub
I hope this work for you.
Juan F. Esquerre
Upvotes: 2