private void Form1_Load(object sender, EventArgs e){ dataGridView1.AutoGenerateColumns = false; DataTable dt = new DataTable("tesr"); DataColumn dcName = new DataColumn("Name", typeof(string)); dt.Columns.Add(dcName); dt.Columns.Add("address", typeof(string)); DataRow dr = dt.NewRow(); dr[0] = "Jappa"; dr[1] = "12, Hector Rd"; dt.Rows.Add(dr); dataGridView1.DataSource = dt; }
Attachment: TestGrid.zip