Multi-column bound combo box in DataGridView

0
0

Hi,

Is there a way that a multi-column bound combo box can be displayed inside a DataGridView control with column headers inside the drop list section of the combo box?

A use case could be something like an order form with orderlines where the user clicks on the drop down combo in a product code column and a gridview displays showing the productID, product code, product description and stock level allowing the user to select the product which then fills the orderline grid.

  • You must to post comments
0
0

Sure you can. But it’s a custom cell editor. You can use a UserComboBox, place a DataGridView (or a panel with multiple controls) in the DropDownControl, then assign an instance of your editor control to column1.Editor. Wisej will use the editor when entering edit mode. You can update the data binding by handling the DGV CellBeginEdit event.

Or the editor control can implement the IDataGridViewEditingControl interface and receive all the notifications like the built-in editors.

There are some samples in the forum. I can see if I can put together a simple example specific to this.

/Luca

  • Andrew Hills
    Thanks Luca. I’ll have a search around and see if I can find the examples. If you do have any other material relating to this then that would be handy too.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.