从网格视图外部的按钮向网格视图添加新行 [英] add a new row to grid view from a button outside the grid view

查看:45
本文介绍了从网格视图外部的按钮向网格视图添加新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在gridview中我有包含下拉列表和文本框的列。在网格外面的按钮单击我想添加一个新行,它将包含与上一行相同的控件。请注意,我只想要ot do是点击网格外的按钮

in gridview i have columns which contain dropdown and textboxes.On button click which is outside the grid i want to add a new row which will contain the same control same as of the previous row.and please mind that all i want ot do is on the click of button which is outside the grid

推荐答案

你好b $ b

你不能直接添加新行在gridview中从外部按钮。



但是按下按钮后的最佳方法是在数据集或数据表中添加一个新行并再次绑定gridview。并在控件的新行中设置默认值(文本框,下拉列表等)。
Hi
You can't directly add new row in gridview from outside button.

But the best way after your button click, add a new row in your dataset or datatable and bind again your gridview. And set default values in new row for your controls(textbox, dropdown etc).


谢谢我在这里找到解决方案



http://www.aspsnippets.com/文章/添加动态行在ASP.Net-GridView-Control-with-TextBoxes.aspx [ ^ ]



我只是在外面使用按钮
thanks i find out solution here

http://www.aspsnippets.com/Articles/Adding-Dynamic-Rows-in-ASP.Net-GridView-Control-with-TextBoxes.aspx[^]

just i use button outside


这篇关于从网格视图外部的按钮向网格视图添加新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆