我有一个桌面应用程序,它在 Datagridview 中显示数据,但是当我单击 Datagridview 的标题时,会自动选择 Datagridview 中的第一个单元格。如何删除gridview中单元格的自动选择?
private void GV_investigate_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (GV_investigate.SelectedRows.Count > 0)
{
int oid = int.Parse(GV_investigate.SelectedRows[0].Cells[0].Value.ToString());
}
}
private void GV_investigate_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
{
GV_investigate.ClearSelection();
}