473,406 Members | 2,619 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,406 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 3952
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
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.