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.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Anupam SinghRank #643 · 3.7K reputationPosted May 21, 2014, 12:44 AM EDT
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
Abhay ShankerRank #375 · 6.7K reputationPosted May 21, 2014, 1:06 AM EDT
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.