CurrentRow = dg.Rows.Count - 1;
dg.Rows[CurrentRow].Cells["YourFieldName1"].Value = txtText1.Text; dg.Rows[CurrentRow].Cells["YourFieldName2"].Value = txtText2.Text;
in button click(write this code) { DataTable dt = new DataTable(); dt = new DataTable(); dt.Columns.Add("Val1"); DataRow dr = dt.NewRow(); dr["Val1"] = TextBox1.Text; dt.Rows.Add(dr); GridView1.DataSource = dt; GridView1.DataBind(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)