kaizen202 0 Newbie Poster

I have hosted my custom combobox (ComboBoxEx) on datagridview by following the steps in http://msdn.microsoft.com/en-us/library/7tas5c80.aspx.

  1. I have created DataGridVIewComboExColumn derrived from DataGridViewColumn
  2. Custom cell named "DataGridVIewComboExCell" is created from DataGridViewCell
  3. Finally my custom edit control "ComboExEditCtrl" (derived from ComboBoxEx and implements IDataGridViewEditingControl) is created.
  4. In ComboExEditCtrl, OnSelectedValueChanged method is overrided as below.

    protected override void OnSelectedValueChanged(EventArgs eventargs)
    {
        // Notify the DataGridView that the contents of the cell 
        // have changed.
        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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.