Click here to Skip to main content
12,241,499 members (52,932 online)
Rate this:
 
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 18:05pm
Edited 24-Feb-12 18: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 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.....:)
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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 20 Jan 2013
Copyright © CodeProject, 1999-2016
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