This is a migrated thread and some comments may be shown as answers.

Multiple Combo boxes

3 Answers 88 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Lori
Top achievements
Rank 1
Lori asked on 02 Mar 2009, 06:20 PM
In the Rasta Travel example at the following url:
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx

I want to be able to select a Continent, and after that continent is selected, I want to run a stored procedure that will get specific notes about that Continent and display these notes in a text box BEFORE the user selects a Country.

Help please.

3 Answers, 1 is accepted

Sort by
0
kmccusker
Top achievements
Rank 1
answered on 02 Mar 2009, 08:50 PM
Hi Lori,

What specifically do you need help with?

Once the user selects a continent, you could get the SelectedValue (through the RadComboBox SelectedIndexChanged event handler) and use this value to execute your stored procedure to retrieve the notes about the selected continent.
0
Lori
Top achievements
Rank 1
answered on 02 Mar 2009, 09:13 PM

The SelectedIndexChanged event does not fire unless the AutoPostBack property is set to True on the combo box, which it is not.
So that never fires.

I tried adding my stored procedure in the SelectedIndexedChanged, right before the Call to LoadCountries.
The stored procedure runs fine and I do see the value come back correctly when I step through the code.
The only thing that doesn't happen is the Notes do not show up on the screen in the text field, txtContinentNotes.

 

 

protected void RadComboBox1_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)

 

{
    

cmd = db.GetStoredProcCommand("dbo.GetCountryNote");

 

    db.DiscoverParameters(cmd);

    cmd.Parameters[

"@continentID"].Value = e.Value;

 

    dr = db.ExecuteReader(cmd);

 

    while (dr.Read())

 

        {

            txtContinentNotes.Text = dr[

"ContinentNotes"].ToString();

 

        }

LoadCountries(e.Text);
}

0
Yana
Telerik team
answered on 04 Mar 2009, 11:41 AM
Hello Lori,

I've attached a sample project illustrating the needed approach. Please download it and give it a try.

Kind regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ComboBox
Asked by
Lori
Top achievements
Rank 1
Answers by
kmccusker
Top achievements
Rank 1
Lori
Top achievements
Rank 1
Yana
Telerik team
Share this question
or