Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在asp.net的gridview行中执行colspan_C#_Asp.net_Gridview - Fatal编程技术网

C# 如何在asp.net的gridview行中执行colspan

C# 如何在asp.net的gridview行中执行colspan,c#,asp.net,gridview,C#,Asp.net,Gridview,如何在gridview中实现以下格式 我也遇到了同样的问题,这就是我找到的解决方案。这是用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

如何在gridview中实现以下格式


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

到目前为止你都尝试了什么?把你的努力放在你的问题上,我试过这个。。。和它不工作等可能重复的Hi请有一次在任何尝试看看这个链接,如果它符合您的要求。我想合并gridview行。不需要嵌套网格视图我得到了要求,但我的想法是在主网格中显示组,并根据数据键在嵌套网格中扩展其行。