0

I have 5 textboxs, 1 button and 1 Gridview control.

I just want that when I click the button, text of each textbox will be added in the Gridview in separate column. Each time I will click the button, a new row must be inserted in the Gridview below the last row.
PLEASE TELL ME HOW TO DO IT

3
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by hirenpatel53
0

First you need to create datatable with some column and bind it with gridview.

Now when you click on button, create NewRow by below way.

DataRow dRow = your DataTable.NewRow();

now your can use dRow object to store value of your text box in below way.

dRow[“your column name in datatable”] = your textbox.Text;

then at the end add this data row to your data table.

Your DataTable.Rows.Add(dRow);

now bind your data table to girdview

Gridview.DataSource = your data table;

I have 5 textboxs, 1 button and 1 Gridview control.

I just want that when I click the button, text of each textbox will be added in the Gridview in separate column. Each time I will click the button, a new row must be inserted in the Gridview below the last row.
PLEASE TELL ME HOW TO DO IT

0

display ur code then will definatly assist u becouse i am not able to understand that u r creating dynamic row or what just show ur code u will get solution

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.