Access value from dynamically generated textboxes in the gridview.
-
I have created a gridview with 2 template fields created at design time. I want to generate more template fields(gridview columns) dynamically at runtime,because no. of columns in the gridview is varying every time.I also need to have a textbox inside every template field. I have done up till generating these template fields along with the textboxes using ITemplete and I can also get these textboxes at the RowDataBound event. Then I am allowing the user to update the values in the textboxes. But when I try to get these textbox values on click event of the submit button which is outside the gridview, I can't find those newly generated columns and hence neither the textboxes. Can anyone please help me to find out the solution to this so that I can get the textbox values on submit button's click event. Thanks.
-
I have created a gridview with 2 template fields created at design time. I want to generate more template fields(gridview columns) dynamically at runtime,because no. of columns in the gridview is varying every time.I also need to have a textbox inside every template field. I have done up till generating these template fields along with the textboxes using ITemplete and I can also get these textboxes at the RowDataBound event. Then I am allowing the user to update the values in the textboxes. But when I try to get these textbox values on click event of the submit button which is outside the gridview, I can't find those newly generated columns and hence neither the textboxes. Can anyone please help me to find out the solution to this so that I can get the textbox values on submit button's click event. Thanks.
Check this it may help you Adding Dynamic Rows in GridView Control with TextBoxes
-
Check this it may help you Adding Dynamic Rows in GridView Control with TextBoxes