Click here to Skip to main content
16,012,352 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all
When i try to fill and Select value from datagridviewcomboboxcell show error Message System.Format exception : datagridviewcomboboxcell value is not valid can anyone help me to solve this

Thanks and Regards
Nisar Aboobacker
Posted
Comments
Animesh Datta 10-Aug-15 3:47am    
show your code
Sergey Alexandrovich Kryukov 10-Aug-15 4:00am    
If you screwed up such a simple thing as DataGridView population, it does not mean there was only one way to do that.
—SA

1 solution

Hello ,

suppose you have one datagridviewcombobox column named as cmbproduct. and if you want to bind the combobox value from dataset then
cmbproduct.DataSource = dsproduct.Tables[0].Columns[0].Table.DefaultView;
cmbproduct.ValueMember = "PId"; 
cmbproduct.DisplayMember = "Pname";

and put this code in window_load or other event .

thanks
 
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