我有一個桌面應用程序,它在Datagridview中顯示數據,但是當我點擊Datagridview的頭時,會自動選擇Datagridview中的第一個單元格。 如何在gridview中刪除單元格的自動選擇?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();
}
你能告訴我們,你想要什麼。你想在oid中獲得選中的單元格值嗎? – kashif 2013-03-15 23:18:56