0
當我單擊單元格(列內容)並按下輸入鍵時,下面的代碼不會返回行索引。當按下輸入鍵時,如何從gridview窗口獲得行索引
private void dataGridView_city_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string grid_row = dataGridView_city.SelectedRows[0].Cells[0].Value.ToString();
}
}