在datagridView中加入一个combox列,怎么能允许用户输入?(winform)
如题。
------解决方案--------------------解决办法如下:
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (dataGridView1.CurrentCell.ColumnIndex == 3) //这里需要你具体的列索引
{
DataGridViewComboBoxEditingControl editCtrl = e.Control as DataGridViewComboBoxEditingControl;
editCtrl.DropDownStyle = ComboBoxStyle.DropDown; //变为这样的下拉风格
}
}