i’m using datagridviewcomboboxcell to display values. I wish this cells value is int. But: when I open combobox I wish to see a description of each item in combo box. When I pick one the value changes (the combobox is closed) and visible value is only int. Does anyone have idea how to do this?
Like: selected item: 2
Expanded combobox: 0 – ene
1 – due
2 – rike
3 – fake
Thanks for help.
Even if you would find a way to set the TextField and ValueField I seriously doubt that you would have different text rendered while the control shows the drop down list (number and text) and while it’s collapsed and shown only as drop down closed (number only).
what you ask make sense of course but you are not going to get it running with no effort just setting few properties.
To handle this in windows forms you should intercept the event: EditingControlShowing and in there, for ComboBox, specify custom values for the control, here is a starting point:
for more details check here: DataGridView.EditingControlShowing Event