2011-10-14 60 views

回答

1

您可以處理DataGridView.KeyDown事件。例如:

object firstCellValue = null; 
    private void dgv_KeyDown(object sender, KeyEventArgs e) 
    { 
     if (e.KeyData == Keys.Enter) 
     { 
      firstCellValue = dgv.Rows[dgv.CurrentCell.RowIndex].Cells[0].Value; 
     } 
    } 
相關問題