Click here to Skip to main content
15,909,466 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi guys,

am developing windows application using C#.net..In that i have one datagridview with two datagridviewcombox column(i.e Country and State)..here i want to load state value based on country selected in Country Column..i need Solution for this..


i tried CellEndEvent but it change previous row state values also ..so please help me out of this guys..

thanks in advance..
Posted

Dear Friend,

You have to write the combobox selected index changed event on the change of which you can get the ID of the country and from there you can fetch the corresponding states of that country and fill the combo box of states accordingly.

Please refer this:-http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.selectedindexchanged.aspx[^]

I hope this will help you out.

Thanks
 
Share this answer
 
v2
Comments
Nathansathya 7-Feb-12 10:24am    
There is no Selected Index Changed Event for DatagridviewCombox Cell!!!
Varun Sareen 22-Feb-12 23:45pm    
have updated my answer. Please see if it can help
Hi,

You can bind the second combobox on combobox1_SelectedIndexChanged event.
check out this link,

http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/783baae3-9733-4f81-8974-6fccb8e6b5aa/[^]

Hope this helps.
 
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