C# WinForm 设置DataGridView选中指定行

int rowIndex=3;//指定行号           

this.dgvInGoodsInfo.Rows[rowIndex].Selected = true;
this.dgvInGoodsInfo.CurrentCell = this.dgvInGoodsInfo.Rows[rowIndex].Cells[0];

你可能感兴趣的:(C#,WinForm)