我试图在运行时搜索dataGridviewcomboboxcoulmn但是没有成功。
private void dataGridView2_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
DataGridViewCell cel = dataGridView2.CurrentCell;
DataGridViewRow r = dataGridView2.CurrentRow;
if (e.Control.GetType() == typeof(DataGridViewComboBoxEditingControl))
{
MessageBox.Show("Tracked");
if (cel == r.Cells[0])
{
DataGridViewComboBoxEditingControl c = e.Control as DataGridViewComboBoxEditingControl;
c.DropDownStyle = ComboBoxStyle.DropDown;
}
}
}