Click here to Skip to main content
15,912,021 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have 3 combobox(item name,brand name,price) but item name can be several brands and each brand has different price. now i want to do that, when user select item name using first combobox then it shows it's appropriate brand in second combobox. and when user select brand name using second combobox then it shows it's price in third combobox.
suppose i have item jeans and it has 5 brands(lee,levise,coutons,cotton county,liver pool) each brand has it's different price(999,1099,1599,2000,2599).
when user select brand=jeans using combobox1 then it shows 5 brands(lee,levise,coutons,cotton county,liver pool) in combobox2 and when user select brand name lee then price should be shown 999 and when user select liver pool then price should be shown 2599 and so on..... in combobox.
what should i do??????
plz help me
thankyou......
Posted
Comments
BillWoodruff 2-Nov-13 6:19am    
Are you accessing a database to get the information that goes into the ComboBoxes ?

Hello ,

try this example..

Cascading ComboBox In Winforms Windows Forms C# VB.NET

thanks
animesh
 
Share this answer
 
Comments
rohith naik 31-Oct-13 4:03am    
Answers it the best !
Try this.
let you have three combobox ddl1 ,ddl2 and ddl3(for item,brand and price respectively.)

write codes(making a separate function fillItemName() ) to fetch data(item name) from database and bind it with ddl1. you must call this function in page_load event.

write codes in ddl1_selectedIndexChanged() to fetch data(brandname) from database using where clause in Query and bind it with ddl2.

write codes in ddl2_selectedIndexChanged() to fetch data(price) from database using where clause in Query and bind it with ddl3(OR write ddl3.Text = ds.Tables[0].rows[0][0].ToString()).

if it works, let me know.
 
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