DataGridView选中一行并且置顶:
dataGridView1.Rows[i].Selected = true;
dataGridView1.FirstDisplayedScrollingRowIndex = i;
去掉标题列
RowHeadersVisible设为false
去掉自动增加的空行
AllowUserToAddRows设为false
一次选中一行
DataGridView.Rows[DataGridView.SelectedCells[0].RowIndex].Selected = true;
或者在属性中的SelectionMode中设置为fullRowSelect
清除所有选中行
dgvSroleinfo.ClearSelection();
删除选中行
DataGridView.Rows.RemoveAt(行号) ( 获取选中行的行号可参考一次选中一行的代码)
光标
cursor