Click here to Skip to main content
16,016,306 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am yogesh sharma and i have a problem that in my Windows forms application, detagridviewcomboxcolumn of my datagridview is not showing any default value at runtime. i have sql table used as a datasource in my datagridviewcomboxcolumn... when i try to select some value it is throwing error ' datagridviewcomboxCell vaalue is invalid '...
I have googled this but not got any clearifications.. So please help..... Any help will be appreciated....
Posted
Comments
[no name] 16-Jul-14 12:10pm    
You are really going to have so show some code if you expect people to make any sense out of this.
yogesh a sharma 16-Jul-14 12:35pm    
thanks but I only need to set default value for datagridviewcomboboxcolumn.
ie; DataGridViewComboBoxColumn cmb = new DataGridViewComboBoxColumn();
cmb.DisplayMember = "dm";
cmb.ValueMember = "vm";
cmb.DataSource = ds; //where ds is the datasource
now i want something like cmb.selectedvalue=1;
but DataGridViewComboBoxColumn doesn't have selectedvalue property....
When my form displays it doesn't show any value selected... By default i need to display first item in my DataGridViewComboBoxColumn...
[no name] 16-Jul-14 12:40pm    
That's because it has a Selected property.
yogesh a sharma 16-Jul-14 12:50pm    
Thanks but selected property does nothing...
yogesh a sharma 16-Jul-14 12:54pm    
Thanks but selected property does nothing

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