如何在asp.net中的gridview行中进行colspan

时间:2014-02-01 08:58:11

标签: c# asp.net gridview

如何在gridview中实现以下格式

enter image description here

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,这是我找到的解决方案。这是在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

我希望这对你有用。

Juan F. Esquerre

答案 1 :(得分:0)

如果符合您的要求,请随时查看此链接。

Grid view with in another grid view(details grid)