DataGridView dataGridView1 = new DataGridView();
DataTable dt = new DataTable();
dt.Columns.Add("姓名", System.Type.GetType("System.String"));
dt.Columns.Add("性别", System.Type.GetType("System.String"));
dt.Columns.Add("年龄", System.Type.GetType("System.Int32"));
dt.Rows.Add(new object[] { "路人甲", "男", 22 });
dt.Rows.Add(new object[] { "路人乙", "女", 20 });
dt.Rows.Add(new object[] { "路人丙", "男", 25 });
dataGridView1.DataSource = dt;