public void SetFouce(int rowHandle)
{
for (int i = 0; i < this.gridView1.RowCount; i++)
{
gridView1.UnselectRow(i);
}
//当rowHandle是-1时选中最后一条(新增时使用)
if (rowHandle == -1)
{
rowHandle = this.gridView1.RowCount;
}
if ((rowHandle != -1) && (this.gridView1.RowCount <= rowHandle))
{
rowHandle = this.gridView1.RowCount - 1;
}
this.gridView1.SelectRow(rowHandle);
this.gridView1.FocusedRowHandle = rowHandle;
}
浙公网安备 33010602011771号