How to host any UserControl in DataGridViewCell permanently?

R

Robert Koch

Hello!

I'm writing a Windows Application and want to
host different User Controls in a DataGridView.

The Controls are not known during design time, they
could be graphs, comboboxes, curves, checkboxes or anything else.

I need them to be shown in the cell not only when I want to edit the
cell, the Controls should be always visible.

So far I see 2 possible solutions:
1. hosting the Controls in the DataGridView itself and paint them over
the referring cell-coordinates. But I have several problems with
scrolling then.

2. My Favorite solution would be to derive the DataGridViewCell-class
and make it to ignore the editmode and host/show the UserControl all the
time. But I have no Idea how to do this. I guess
IDataGridViewEditingCell could help?

Any help would be very appriciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top