[SOLVED] Multi Column Combo Box

Answered
1
1

What’s the best way to create a data bound multi column Combo box?

To use a user combo box coupled with a data grid view?

Or to use a ListViewCombo Box

I have created a MCCB by using a custom user control and adding a custom combo box and linking it to a DGV.

I have then reduced the size of the user control to that of the combo box and dicked the combo box to the control.

When a try to populate the DGV, however no columns get added, despite the DataTable in the BindingSource  containing values

public void refreshMCC(BindingSource BS)
{
bsCombo = BS;
dgvMCC.ColumnHeadersHeight = MultiColumnCombo.Height;
dgvMCC.AutoGenerateColumns = true;
dgvMCC.DataSource = bsCombo;
}

Is there an example I can look at?

Thanks for your help Ewan

  • You must to post comments
Good Answer
0
0

Hi Ewan,

Our new development build 1.5.44 includes the following fix & enhancement:

  • If a control is created without a parent, its BindingContext is not initialized (#1772)
  • DGV sorting preserves current data row when sorting the data source. (#1774)

Best regards
Frank

 

  • Ewan Walker
    Hi Frank many thanks issues have been fixed, apart from DGV not displaying correctly on Edge (some gridlines missing randomly – Clear 3 Theme)
  • Ewan Walker
    The fix for this is to call BScombo.RemoveFilter (even though there is none which causes the binding source to refresh the grid) after the control is initialized and populated, as it will not calculate the drop down height correctly, Typically misses a row, despite it calculating the grid dimensions correctly.
  • You must to post comments
0
0

Hi Frank

Project I am working on has been sent

Ewan

 

  • Frank (ITG)
    Got it, thanks Ewan. Will check and get back to you. Best regards, Frank
  • You must to post comments
0
0

Hi Ewan,

can you please share your test code so we can take a look at it ?

Thanks in advance.

Best regards
Frank

  • You must to post comments
0
0

I created a test DGV and used the same code to populate it and it works fine.

The event DataBindingComplete does fire

So it seems you cannot use a DGV as a drop down on a combo box in a straightforward way.

(Does it need to be a user control containing a docked dgv and the user control used as the drop down?)

The event DataBindingComplete does not fire despite the binding source changing.

An empty DGV drops down.

Also noticed with the test grid that auto sizing the columns based on row contents does not work.

DGV display is flaky on Edge missing grid lines etc. (Not IE or Chrome)

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.