int sitting = Convert.ToInt32(D3.Text); DataTable dt = new DataTable(); DataRow dr; dt.Column1.Add("Treatment Name"); dt.Columns.Add("Detail"); dt.Columns.Add("amount"); for (int i = 0; i < sitting; i++) { dr = dt.NewRow(); dr["Treatment Name"] = D1.Text; dr["Detail"] = D2.Text; dr["amount"] = ""; dt.Rows.Add(dr); } dataGridView1.DataSource = dt;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)