Solved

Selecting Items in Cascading Drop Down List Box

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

770 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