Add rows dynamically to gridview

2019-08-12 06:04发布

问题:

I have a gridview and I want to add rows in it dynamically. I have a dropdown list and it has values through 2 to 12. 2 is selected by default and gridview has two rows in it. And 3 columns. First column contains count, second contains a textbox and third also contain a text box. What I want is, when user change ddl value, suppose from 2 to 3, a new row with same data must be added to gridview. How can I achieve this?

Any help would be appreciated.

回答1:

check out below links, hope it will solve your issue.

http://geekswithblogs.net/dotNETvinz/archive/2009/06/04/adding-dynamic-rows-in-gridview-with-textboxes.aspx

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