110,578
社区成员
发帖
与我相关
我的任务
分享
private void dataGridView1_Click(object sender, EventArgs e)
int name = this.dataGridView2.CurrentRow.Index;
this.dataGridView2.Rows.Insert(name + 1, 1);
int index = 0;
if (this.dataGridView1.CurrentRow != null)
index = this.dataGridView1.CurrentRow.Index + 1;
object[] cellValues = new object[] {第1个单元格的值, 第2个单元格的值, ....};
this.dataGridView1.Rows.Insert(index, cellValues);