Click here to Skip to main content
15,909,466 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using 4 dropdown in my project 1)make 2)model 3)Transmission 4)fuel.I am using cascading dropdown for this.The problem is I want to get the "transmission" according to the "make" and the "Model" means I want to set "make" and "model" as parent id for "transmission". Please suggest me a suitable solution?
Posted
Comments
Kalesh.S.R 10-Aug-11 2:10am    
please suggest an answer for me.
Kalesh.S.R 11-Aug-11 0:00am    
:(

1 solution

you can do as follow:

C#
page_load()
{
 if(!ispostback)
{
 binddropdown1();   
}
}
dropdown1_selectedchange()
{
  binddropdown2();   
}
dropdown2_selectedchange()
{
  binddropdown3();
}
dropdown3_selectedchange()
{
  binddropdown4();
}

binddropdown1()
{
dropdown2, dropdown3, dropdown4.clear();
dropdown1.datasource = dt;
dropdown1.textfield = ""
dropdown1.datafield = "";
dropdown1.selectedindex = 0;
}   
binddropdown2()
{
dropdown3, dropdown4.clear();
dropdown2.datasource = dt; where fieldid = dropdown1.selectedvalue;
dropdown2.textfield = ""
dropdown2.datafield = "";
}
binddropdown3()
{
dropdown4.clear();
dropdown3.datasource = dt; where fieldid = dropdown2.selectedvalue;
dropdown3.textfield = ""
dropdown3.datafield = "";
}   
binddropdown4()
{
dropdown4.datasource = dt; where fieldid = dropdown3.selectedvalue;
dropdown4.textfield = ""
dropdown4.datafield = "";
}   
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900