I\'ve seen How to: Host Controls in Windows Forms DataGridView Cells which explains how to host a control for editing a cell in a DataGridView. But how can I host a control for
As per your "UPDATE", creating a custom DataGridViewCell
is the way this is done. I've done it, and it doesn't require that much modification from the example code available from the MSDN. In my case, I needed a bunch of custom editing controls, so I ended up inheriting from DataGridViewTextBoxCell
and DataGridViewColumn
. I inserted into my class (the one inherited from DataGridViewTextBoxCell
) a new custom control which implemented IDataGridViewEditingControl
, and it all just worked.
I suppose that in your case, you could write a PanelDataGridViewCell
which would contain a control MyPanelControl
which would inherit from Panel and implement IDataGridViewEditingControl
.