Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.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/0/asp.net-mvc/16.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
如何在asp.net mvc中扩展子网格_Asp.net_Asp.net Mvc - Fatal编程技术网

如何在asp.net mvc中扩展子网格

如何在asp.net mvc中扩展子网格,asp.net,asp.net-mvc,Asp.net,Asp.net Mvc,我有一个gridview数据,这个gridview也有子网格。 在网格视图的第一列中,使用+符号,以便展开网格以查看子网格。。但现在的问题是,我需要在网格底部有一个按钮,以便一次展开所有gridview子网格 谢谢为用于展开行的每个按钮提供一个类,然后使用jQuery触发器: <table> <tr> <td><button class='expand-row-button'>+</button></td>&l

我有一个gridview数据,这个gridview也有子网格。 在网格视图的第一列中,使用+符号,以便展开网格以查看子网格。。但现在的问题是,我需要在网格底部有一个按钮,以便一次展开所有gridview子网格


谢谢

为用于展开行的每个按钮提供一个类,然后使用jQuery
触发器

<table>
  <tr>
     <td><button class='expand-row-button'>+</button></td><td>other things</td>
  </tr>
  <tr>
     <td><button class='expand-row-button'>+</button></td><td>other things</td>
  </tr>
  <tr>
     <td><button class='expand-row-button'>+</button></td><td>other things</td>
  </tr>
</table>

<button onclick="$('.expand-row-button').trigger('click');">Expand all rows</button> 

+其他事情
+其他事情
+其他事情
展开所有行
**编辑**


因为您使用的是jqGrid,所以应该查看方法。此方法用于扩展具有指定id的行。您可以迭代视图中的行并生成代码来扩展每一行。

ASP.NET-MVC没有任何GridView功能,并且ASP.NET控件不兼容()-当然可以使用许多其他库来实现它-也许这是什么?你是谁,为什么取名为tncbbthositg?谢谢你的重播..我需要将按钮放在网格下,我需要在一次按钮点击事件中展开所有行。。。请问上面的代码是做同样的事情吗?谢谢这个展开行按钮是什么?从哪里我们需要给出这个?如果用于展开行的每个按钮都有class
expand row button
,并且您使用jQuery,那么这应该可以工作。这段代码创建了一个按钮,当单击该按钮时,会触发所有展开按钮的单击。同样,我有这样的gridview。。同样,我需要将按钮保持在网格底部,以便一次扩展所有+符号。。thanks@tncbbthositg:也许这篇文章会有帮助: