hiding a rows in DataGridViewComboBoxColumn

N

Nik Edmiidz

After a value from the combobox has been selected in a previous row of the
DataGridView, I would like to hide that value from being selectable in the
combobox in a new row of the DataGridView.

Here is a visual sample of what I'm trying to do:
http://oha.nu/accepted_creditcards.gif

I've found code to hide rows from DataGridView, but not from the
DataGridViewComboBoxColumn.

Any help much appreciated.

thanks,
Nik Edmiidz
 
T

Tim Van Wassenhove

After a value from the combobox has been selected in a previous row of the
DataGridView, I would like to hide that value from being selectable in the
combobox in a new row of the DataGridView.

Here is a visual sample of what I'm trying to do:
http://oha.nu/accepted_creditcards.gif

The only solution i've found until now is the following:

- Add all available values to the ComboBoxColumn
- Handle the EditingControlShow event of the DataGridView: check if
e.Contol is a ComboBox, and remove the values that shouldn't be
available at that time from the Items collection on that ComboBox.
 

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