473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Dependent Dropdown Lists in C#

I am trying to find a way to create dependent dropdown lists in C# The old
way I knew involved javascript and will no longer work in the new design. I
need for each list to be database driven (data is pulled from database)

Example:
First Box would have Years 2004, 2003, 2002, 2001, etc.
Second Box: would have Ford, Chevy, Dodge, Toyota, Honda, etc
Third Box would have items based from first selelction(if Ford chosen)
F-150, Explorer, Bronco, etc

Does anyone have any thought on how this can be accomplished, I have stumped
all my fellow coworkers.

Thanks
Nov 22 '05 #1
2 3949
Hi Tony,

Are you saying you want to avoid a postback event and dump all data onto the client and then sort
from there using javascript?
If so you can just registerscript using a couple of different methods as outlined here:

http://msdn.microsoft.com/library/de...sidescript.asp
Otherwise i would say just define an OnSelectedIndexChanged event with autopostbackack enabled on
the second cbo, handle that on the server and then fill the third combos datasource from the db
depending on the selected value of the second cbo. However if you've stumped all your co workers
then im inclined to wonder if this is too simplistic and not what you want?

Richard
"Tony Grider" <To********@discussions.microsoft.com> wrote in message
news:98**********************************@microsof t.com...
I am trying to find a way to create dependent dropdown lists in C# The old
way I knew involved javascript and will no longer work in the new design. I
need for each list to be database driven (data is pulled from database)

Example:
First Box would have Years 2004, 2003, 2002, 2001, etc.
Second Box: would have Ford, Chevy, Dodge, Toyota, Honda, etc
Third Box would have items based from first selelction(if Ford chosen)
F-150, Explorer, Bronco, etc

Does anyone have any thought on how this can be accomplished, I have stumped
all my fellow coworkers.

Thanks

Nov 22 '05 #2
Thank you Richard for the reply, Im looking at the link currently to see if
this is what I needed.

If there are other suggestions as well they would be greatly appreciated as
well

"Richard Myers" wrote:
Hi Tony,

Are you saying you want to avoid a postback event and dump all data onto the client and then sort
from there using javascript?
If so you can just registerscript using a couple of different methods as outlined here:

http://msdn.microsoft.com/library/de...sidescript.asp
Otherwise i would say just define an OnSelectedIndexChanged event with autopostbackack enabled on
the second cbo, handle that on the server and then fill the third combos datasource from the db
depending on the selected value of the second cbo. However if you've stumped all your co workers
then im inclined to wonder if this is too simplistic and not what you want?

Richard
"Tony Grider" <To********@discussions.microsoft.com> wrote in message
news:98**********************************@microsof t.com...
I am trying to find a way to create dependent dropdown lists in C# The old
way I knew involved javascript and will no longer work in the new design. I
need for each list to be database driven (data is pulled from database)

Example:
First Box would have Years 2004, 2003, 2002, 2001, etc.
Second Box: would have Ford, Chevy, Dodge, Toyota, Honda, etc
Third Box would have items based from first selelction(if Ford chosen)
F-150, Explorer, Bronco, etc

Does anyone have any thought on how this can be accomplished, I have stumped
all my fellow coworkers.

Thanks


Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Toonman | last post by:
I have a webpage with a <form> consisting of a large table grid of dropdown lists used to make changes in a database. Some of these dropdown lists have the same value. I'm trying to make it so...
2
by: Tony Grider | last post by:
I am trying to find a way to create dependent dropdown lists in C# The old way I knew involved javascript and will no longer work in the new design. I need for each list to be database driven (data...
0
by: Mike O. | last post by:
MS Access 2003 "filter by form" has drop down lists that allow the user to select values for each field to filter by. However, once some values are selected,the remaining dropdown lists remain the...
0
by: Henke | last post by:
Hi, I have done some research about my problem I have when using the "back button" in IE to go back to a page with two dropdown lists. The both dropdown lists are populated with data. The...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
1
by: Hifni Shahzard | last post by:
Hi, I'm using VS.NET 2003, SQL Server 2000, Windows xp professional; My Question: Some of you might seen in some websites where it requests the Country in a dropdown. If the Country selected,...
5
by: Bels | last post by:
I am currently designing a real estate website using Dreamweaver CS3, php, MySQL on a Mac. On it is a 'property search' form that queries the property database. The form consists of 5 dropdown lists....
3
by: pugalenthi | last post by:
I have created a dropdown box which is populated by data from the mssql server database connected using ODBC. Now i need to populate another dropdown box which will also be from the database but will...
1
by: kanimozhiz | last post by:
Hi, I am using dropdown lists. What I need is on the selection of one item in one dropdown list, the second dropdown list should get populated accordingly. can anyone tell me how to do this in C#...
3
by: John | last post by:
I have two dropdown lists that I have bound to a datatable and set the DataTextField and DataValueField for. Both lists show the values I expect from the database. However, when I need to access...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.