Click here to Skip to main content
Sign Up to vote bad
good
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


4 solutions

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 - 25-Feb-12 0:50am
nice lnk. my 5
Abhinav S - 25-Feb-12 0:50am
Thank you Aslam.
Аslam Iqbal - 25-Feb-12 0:52am
you are welcome.....:)
Inside DataGridview need load Country,state and city.
  Permalink  
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  

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 6,889
1 Prasad_Kulkarni 3,671
2 OriginalGriff 3,359
3 _Amy 3,312
4 CPallini 2,925


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