//向DataGrid增加一行并记录下新增行的索引值
int index = this.dataGridView1.Rows.Add("1", "产品名称");
//设置新增的行为选中状态
this.dataGridView1.Rows[index].Selected = true;
//移动DataGrid左边的三角形箭头
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[index].Cells[0];
C# DataGridView选中新增行、移动三角形箭头
最新推荐文章于 2024-06-14 15:55:33 发布