Solved

Selecting Items in Cascading Drop Down List Box

Posted on 2007-11-16
2
3,173 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
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now