I have gridview built dynamically at run-time bind to datatable, and button to save gridview data placed outside gridview1- Create GridView\[code\]protected void Page_Load(object sender, EventArgs e){ if (!IsPostBack) { CreateGrid(); }} void CreateGrid() { int nTransID = Convert.ToInt32(Session["trans_id"]); // string strSQL = @"EXEC [dbo].[sp_GetTransaction] " + nTransID; DataTable dtData = http://stackoverflow.com/questions/13778707/clsGlobal.GetDataTable(strSQL); // if (ViewState["dtTransDetail"] == null) ViewState.Add("dtTransDetail", dtData); else ViewState["dtTransDetail"] = dtData; // foreach (DataColumn dc in dtData.Columns) { if (dc.ColumnName.Contains("!;")) { TemplateField tField = new TemplateField(); tField.ItemTemplate = new AddTemplateToGridView(ListItemType.Item, dc.ColumnName); //\\ --- template contain textbox tField.HeaderText = dc.ColumnName; GridView1.Columns.Add(tField); } } }\[/code\]This is my template class:\[code\]public class AddTemplateToGridView : ITemplate { ListItemType _type; string _colName; public AddTemplateToGridView(ListItemType type, string colname) { _type = type; _colName = colname; } void ITemplate.InstantiateIn(System.Web.UI.Control container) { switch (_type) { case ListItemType.Item: TextBox text = new TextBox(); text.ID = "txtAmount"; text.DataBinding += new EventHandler(txt_DataBinding); container.Controls.Add(text); break; } } void txt_DataBinding(object sender, EventArgs e) { TextBox textBox = (TextBox)sender; GridViewRow container = (GridViewRow)textBox.NamingContainer; object dataValue = http://stackoverflow.com/questions/13778707/DataBinder.Eval(container.DataItem, _colName); if (dataValue != DBNull.Value) { textBox.Text = dataValue.ToString(); } } }\[/code\]So i have a gridview with textboxe's all open to edit at onceThe problem is, when i click on Save button "which is outside gridview" all textboxe's gone\[code\]protected void btnSave_Command(object sender, CommandEventArgs e) {for (int nRow = 0; nRow < GridView1.Rows.Count; nRow++) { for (int nCol = 0; nCol < GridView1.Columns.Count; nCol++) { if (GridView1.Rows[nRow].Cells[nCol].Controls.Count == 0) continue;//\\ --- Controls.Count always = 0//\\ --- However each cell contain textbox//\\ --- textbox disappear after save button clicked TextBox txt = (TextBox)GridView1.Rows[nRow].Cells[nCol].Controls[0]; } }}\[/code\]