Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3201
  • Last Modified:

Selecting Items in Cascading Drop Down List Box

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
ericlockshine
Asked:
ericlockshine
1 Solution
 
ericlockshineAuthor Commented:
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
 
NetminderCommented:
Closed, 500 points refunded.
Netminder
Site Admin
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now