在 运行 次单击按钮时在 GridView 页脚中插入新行

Insert New Row In GridView Footer At Button Click at Run Time

我只想在单击按钮时在 gridView 页脚中插入新行,该行位于 gridview 的外侧。每次用户单击“打开”按钮时,都会在 gridview 页脚中插入新行,用于使用文本框输入数据。 GridView 数据行显示来自数据库的数据和包含新条目文本框的页脚行。用户可以通过单击按钮添加多个带有文本框的页脚行。 请帮我... 谢谢...

我们有类似的情况,但是我们是动态地向 table 的正文添加行。没有理由类似的方法行不通。请注意,如果您需要将此数据提交回服务器,则需要实现一些附加功能。

部分代码如下。

$('button').click(function () {
    var newRow = $('table tfoot').First('.Row').clone();  // If you need to insert dynamically you can create the elements in code
    $('table tfoot').append(newRow);    
});