Hi,
I am writing the following code in c# windows applications.i want to display textbox value to datagrid.
the following code display first value to grid.i want to display all entered textbox value to gridview.this code display only last entered value.any one help me please
private void button1_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add("SNo");
dt.Columns.Add("Name");
dt.Columns.Add("Age");
dt.Columns.Add("Country");
dr = dt.NewRow();
dr["Name"] = textBox1.Text;
dr["Age"] = textBox2.Text;
dr["Country"] = textBox3.Text;
dt.Rows.Add(dr);
dataGridView1.DataSource = dt;
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
}