Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

DataGridViewComboBoxCell value is not valid

$
0
0

Hi All,

In my application's DataGridView there are 3 ComboBoxColumns. Out of which two are filled by Enumerator type and one from DataSet.

I set Generic Class object as DataSource to DataGridView. Based on the values in this object I want those ComboBoxColumns values to be selected and relevant DisplayMember has to get displayed.

It works only for 2 ComboBoxColumns which are filled with Enumerator Type. But third combo shows ValueMember as DisplayMember and gives error :

“System.Argument.Exception: DataGridViewComboBoxCell value is not valid”

When handled in DataError event shows DataGridViewDataErrorContexts Formatting | Display errors.

In CellFormattingEvent I have converted all the ComboBoxColumn Values to String type.

I have set AutoSizeColumnsMode to "None". Also tried with setting it to "NotSet" but didn't worked.

What could be the reason for it?

Plz help me to solve this.


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>