DataGridView with DataGridViewComboBoxColumn

E

ewald.de.vries

Hello,

Using the .NET 2.0 datagridview with databound combobox columns, I can
display the human-readable value for foreign keys in my dataset.
However, each of the comboboxes has a dropdown button that cannot be
used, since the gridview is set to be read-only.

I would like to remove the drop-down button (5 out of 10 columns show
this unusable button currently), but cannot seem to figure out how to
make that work.

What is the mechanism (if any) to remove the dropdown button for all
of the combobox columns, so that it appears as a nice read-only list?

Any advice much appreciated.

Thanks,
Ewald
 
J

Jim Wooley

Using the .NET 2.0 datagridview with databound combobox columns, I can
display the human-readable value for foreign keys in my dataset.
However, each of the comboboxes has a dropdown button that cannot be
used, since the gridview is set to be read-only.

I would like to remove the drop-down button (5 out of 10 columns show
this unusable button currently), but cannot seem to figure out how to
make that work.

You should be able to set the DropDownStyle for the column to Nothing (note:
this is System.Windows.Forms.DataGridViewComboBoxDisplayStyle.[Nothing],
not Null/Nothing).
Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
 

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