Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 3

Inside DataGridview need load Country,state and city.
  Permalink  
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

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 462
1 sanket saxena 355
2 OriginalGriff 235
3 Abhinav S 233
4 CPallini 205
0 Sergey Alexandrovich Kryukov 8,784
1 OriginalGriff 5,025
2 Peter Leow 3,839
3 Maciej Los 3,535
4 Er. Puneet Goel 3,107


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