日期:2014-05-18 浏览次数:21167 次
BindingSource moniterBindSource = new BindingSource(); moniterBindSource.DataSource = robj.readlog(); dataGridView1.DataSource = moniterBindSource;
string[,] array = new string[4, 2]; array[0, 0] = "001"; array[0, 1] = "张三"; array[1, 0] = "002"; array[1, 1] = "老李"; array[2, 0] = "003"; array[2, 1] = "小王"; array[3, 0] = "004"; array[3, 1] = "衰哥"; dataGridView1.Rows.Clear(); for (int m = 0; m < 4; m++) { dataGridView1.Rows.Add(1); for (int n = 0; n < 2; n++) { dataGridView1.Rows[m].Cells[n].Value = array[m, n].ToString(); } }