Hi friends
Well here i am looking to create a 3-level combo box cascading filter like in example Country--> State --> City :)
Upon selection in countries in combo-box1 respective states should display in combo-box2 the after upon state selection cities should get displayed under combo-box3 . (like drill down).
My work : I used arrays to store states of respective countries & the after i am able to display states in combo-box2 upon country selection in combo-box1 .
Well then after , on selection of req'd state i was unable to develop the logic to get what i req'd i.e
I have created country list into combobox-1 (india,usa,australia) in collection & binded event proc of combobox-1 with combobox-2
string[] s1 = { "AP","UP","Delhi"};
string[] s2 = { "chicago","Dallas"};
string[] s3 = { "melborne","sydney"};
string[] s4 = { "AP1", "Ap2" };
string[] s5 = { "UP1", "UP2" };
string[] s6 = { "Delhi1", "delhi2" };
string[] s7 = { "c1", "C2" };
string[] s8 = { "Dallas1" };
string[] s9 = { "M1","M2" };
string[] s10 = { "S1","S2" };
private void Form11_Load(object sender, EventArgs e)
{
comboBox2.Items.Clear();
switch (comboBox1.SelectedIndex)
{
case 0: comboBox2.Items.AddRange(s1);
break;
case 1: comboBox2.Items.AddRange(s2);
break;
case 2: comboBox2.Items.AddRange(s3);
break;
}
So anyone can help me with this bizarre situation :( Need logic to implement this in c#.net windows forms
Thanks in advance
Loading

Jignesh TrivediPosted Feb 13, 2013, 2:50 AM
http://csharpdotnetfreak.blogspot.com/2012/07/cascading-combobox-in-winforms-windows-forms.html
is containing code in both language c#, as well as VB.
logic to fill city combo from state combo is same as first level
write code on selected change event of state combo and at this time fill up city combo.
hope this will help you.
SUNIL GUTTAPosted Feb 14, 2013, 9:07 AM
I tried this under the combobox2 event proc i got everything well and good but some minor disturbances :
1.after i get drop down in city combo with respect to selected state in combo2 . wen we click on city name it is throwing an error ..wat should i do ??
2.And i think this code of level2-3 combo is lengthy way of doing is there any idea or solution about it
Thank you .. C# , windows form experts come on help me to become one of you :)
SUNIL GUTTAPosted Feb 13, 2013, 2:17 AM
But i am new to c#.net & windows forms itself so i may find tough to understand that too vb.net where i am zero at that . .
So if you don't mind if u r well with VB & windows form in c# . can you please tell me only just logic in stage 2 ---> 3 to get cities from states ?
Jignesh TrivediPosted Feb 13, 2013, 1:45 AM
please refer below link
http://csharpdotnetfreak.blogspot.com/2012/07/cascading-combobox-in-winforms-windows-forms.html
it might help you.