Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I am getting the following error and DataGridViewComboBoxColumn in the grid does not display the value properly.
DataGridViewComboBoxCell value is not valid.


The Id is displayed in the grid rather than the value.

I just want to display the displaymember in the combo column of the grid.
Can anyone help me.
Posted
Updated 26-Sep-13 6:00am
v2
Comments
Pradeep Shukla 26-Sep-13 12:01pm    
Have you set the bindingsource for the DataGridViewComboBoxColumn that you using?

1 solution

Let Assume DatagridComboboxcell name in cmbBox

Try below code...
C#
cmbBox.Datasource=lstofids; //list of display member and value member object
cmbBox.DisplayMember="Displaymembername";
cmbBox.ValueMember="Valuemembername";



still if u are getting error u are doing wrong binding to data grid check that also
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900