I have hosted my custom combobox (ComboBoxEx) on datagridview by following the steps in http://msdn.microsoft.com/en-us/library/7tas5c80.aspx.
- I have created DataGridVIewComboExColumn derrived from DataGridViewColumn.
- Custom cell named "DataGridVIewComboExCell" is created from DataGridViewCell.
- Finally my custom edit control "ComboExEditCtrl" (derived from ComboBoxEx and implements IDataGridViewEditingControl) is created.
In ComboExEditCtrl, OnSelectedValueChanged method is overrided as below.
protected override void OnSelectedValueChanged(EventArgs eventargs)
{
valueChanged = true;
this.EditingControlDataGridView.NotifyCurrentCellDirty(true);
base.OnSelectedValueChanged(eventargs);
}
Whenever the grid is loaded, custom control (ComboExEditCtrl) displayed on the cell. The problem is when I change the value on custom control (ComboExEditCtrl) and click on the next cell the custom control disappears. Also when i click back on the same cell (custom control cell) in the datagridview the custom control appears.
I have followed almost the same steps described in MSDN (above link). I dont know what I am missing. Please help