You have a DataGridView with just 1 column in it, and it is "a combobox
type," but you say that there doesn't seem to be a
DataGridViewComboBoxColumn "object" - - what exactly do you think the
"combobox type" column in your DataGridView is? Well, apparently you do not
know, but it's a DataGridViewComboBoxColumn. You even got the name right! In
fact, there are several classes associated with this one:
DataGridViewComboBoxColumn
DataGridViewComboBoxCell
DataGridViewComboBoxEditingControl
DataGridViewComboBoxCell.ObjectCollection
DataGridViewComboBoxDisplayStyle
So, I'm scratching my head trying to figure out where the disconnect is,
here. My guess is that you are aware that the DataGridView has a Columns
Collection, which is a Collection of DataGridViewColumn instances, a Rows
Collection, which is a Collection of DataGridViewRow instances, and that
each row has a Collection of DataGridViewCell instances. Now, you'll notice
that in my list there is a DataGridViewComboBoxCell class.
DataGridViewComboBoxColumn inherits DataGridViewColumn, and
DataGridViewComboBoxCell inherits DataGridViewCell. This is so that you can
add a DataGridViewComboBoxColumn to a DataGridView, or any other type of
DataGridViewColumn-derived class. In other words, all you have to do is cast
it as a DataGridViewComboBoxCell to get at its unique properties.
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Steve Marshall" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, I have an unbound DataGridView with just 1 column in it. The
> column is a combobox type, and I need to be able to attach the
> datasource to it programmatically. This is because it is a DataTable
> that gets built dynamically at runtime. But I can't see how to get at
> the underlying combobox that "belongs" to the column. Anyone know how
> to do this? It has to be in there somewhere! There doesn't even seem
> to be a DataGridViewComboBoxColumn object (or similar), so obviously I
> am looking in the wrong direction. Somebody please adjust my
> headspace!
>