how to bind data to gridview but not save to database
i have a header template within gridview and header template contains 4 textboxes and a button(add) if i click on add button then 4 textboxes values should be binded to gridview but not to save to database.
Abhay ShankerPosted May 21, 2014, 5:06 AM
As your textboxes are in header template and if you want to add multiple rows in gridview, you need to store the database in view state also.so that you can add record in existing table.
Anupam SinghPosted May 21, 2014, 4:44 AM
You might using datatable or dataset for filling grid view.
so you have add row in datatable or dataset
using :
DataTable table = new DataTable(); // this is your datatable.
// add data from db
//then add column manually
table.Columns.Add("column1", typeof(int));
table.Columns.Add("column2", typeof(string));
table.Columns.Add("column3", typeof(string));
//add row
hope this will help