Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows Application
I am new in windows application. In my Datagridview i have 3 comboBox Country,State,City. Based on Country, State need to load, Based on State City Need to Load.Give Sample Example.
 
Thanks For Advance
Posted 24-Feb-12 17:05pm
Edited 24-Feb-12 17:06pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Have a look at the DataGridViewComboBoxColumn class[^]. Cascading dropdowns might help you create a selection where you can choose country, state and city.
  Permalink  
Comments
Аslam Iqbal at 25-Feb-12 0:50am
   
nice lnk. my 5
Abhinav S at 25-Feb-12 0:50am
   
Thank you Aslam.
Аslam Iqbal at 25-Feb-12 0:52am
   
you are welcome.....:)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

var newColumn = new DataGridViewComboBoxColumn() {
    Name = "abc"
};
newColumn.DataSource = new string[] { "a", "b", "c" }; 
dgv.Columns.Add(newColumn);
 
However, now I would like to trim the list for certain rows. I'm trying to set the list per row like this:
 
foreach (DataGridViewRow row in dgv.Rows) {
    var cell = (DataGridViewComboBoxCell)(row.Cells["abc"]);
    cell.DataSource = new string[] { "a", "c" };
}
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Inside DataGridview need load Country,state and city.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 359
1 _Amy 230
2 OriginalGriff 220
3 Manfred R. Bihy 190
4 Andreas Gieriet 180
0 OriginalGriff 7,495
1 Sergey Alexandrovich Kryukov 6,402
2 Maciej Los 3,849
3 Peter Leow 3,568
4 CHill60 2,702


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 20 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100