private delegate void SetCellMethod(DataGridView ctrl, int nRow, int nCol, DataGridViewComboBoxCell cell); private void SetCellImpl(DataGridView ctrl, int nRow, int nCol, DataGridViewComboBoxCell cell) { m_nEntered = nCol; //记录当前选中的列 ctrl.Rows[nRow].Cells[nCol] = cell;//将cell更改为DataGridViewComboBoxCell使其可编辑 } private void SetCell(DataGridView ctrl, int nRow, int nCol, DataGridViewComboBoxCell cell) { SetCellMethod MyMethod = new SetCellMethod(SetCellImpl); ctrl.BeginInvoke(MyMethod, new object[] { ctrl, nRow, nCol, cell }); } 在CellEnter时使用委托设置Cell,并且需增加判断防止反复CellEnter,CellLeave,否则就会引发SetCurrentCellAddressCore可重入调用 //假设DataGridView为View1 private void View1_CellEnter(object sender, DataGridViewCellEventArgs e) { if (m_nEntered == e.ColumnIndex && e.ColumnIndex == e.RowIndex) { View1.BeginEdit(true); return; } //设置允许编辑内容,使用DataGridViewComboBoxCell的列调用SetCell,并且 //DataGridViewComboBoxCell comboCell = new DataGridViewComboBoxCell(); //comboCell.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; View1.BeginEdit(true); } private void View1_CellLeave(object sender, DataGridViewCellEventArgs e) { //设置DataGridView对应列的内容,结束DataGridViewComboBoxCell编辑 View1.EndEdit(); }