//向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选中新增行、移动三角形箭头
最新推荐文章于 2026-04-29 07:20:01 发布

3733

被折叠的 条评论
为什么被折叠?



