?
Solved

Selecting Items in Cascading Drop Down List Box

Posted on 2007-11-16
2
Medium Priority
?
3,193 Views
Last Modified: 2008-02-01
I am converting a web site into a .NET AJAX enabled web site.
I am using 5 cascading drop down list boxes so that the user can only select what is appropriate for the item.  They are in order Series, Enclosure, Speed, Manufacturer and Model.  I am storing this information into a database (in text).  When the user goes back in, I want to have these items populated with the previous selections.

How do I do this?

I have the following lines of code (C#):
string series = dtTable.Rows[0]["systemtype"].ToString();
string enclosure = dtTable.Rows[0]["enclosure"].ToString();
string speed = dtTable.Rows[0]["speed"].ToString();
string manu = dtTable.Rows[0]["manufacture"].ToString();
string model = dtTable.Rows[0]["model"].ToString();
DropDownList1.SelectedItem.Text = series;
DropDownList2.SelectedItem.Text = enclosure ;
DropDownList3.SelectedItem.Text = speed ;
DropDownList4.SelectedItem.Text = manu ;
DropDownList5.SelectedItem.Text = model ;
When I bring up the page, nothing is there!

Am I doing something wrong with the CascadingDropDownListBox?  Do I need to do this at a different time than in the Page_Load event?

Thanks in advance for the help!
0
Comment
Question by:ericlockshine
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:ericlockshine
ID: 20305965
I've Solved My own problem here.  I am putting this in the solutions so that other programmers don't have to search everywhere to find it.

The answer is:
Use the CascadingListBox.SelectedValue setting.  Set this equal to one of the selections in the list and you will select that item (after the request comes back from the WebService Call.  Also, be sure that you don't immediatly try to access the DropDownListBox that it is associated with or you may lose your data in the event (likely) that the DDL doesn't have any data just yet.
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 20308244
Closed, 500 points refunded.
Netminder
Site Admin
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question