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

Related ComboBox questions!

1 Answer 55 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 18 Oct 2012, 01:40 PM
I am following the demo here for the related ComboBoxes and have a couple questions.

Related ComboBox Demo

But I need it to expand to do the following.
  1. On Page_Load doing an edit where I have the continent and country already saved in the database how do I load it?
  2. When I select on the city and press Explore the city is not being passed correctly.  It is always sending the intial load city not the on selected. 

Your help is appreciated.
Thank You!

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 19 Oct 2012, 03:26 PM
Hi Michael,

Regarding your first question - you can obtain the value that you want to pre-select from your database and set the selected item in the first RadComboBox in this way:

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        // Fill the continents combo.
        LoadContinents();
 
        // Here you can query your database and obtain the value of the RadComboBoxItem that you want to set as selected
        this.RadComboBox1.FindItemByValue("2").Selected = true;
    }
}

The selection of City works properly on our demo - please take a look at this demonstration video.
Please check the values of the items that you load in the "City" combo on your side.
The values of RadComboBox items need to be unique - as is explained in this help article.

All the best,
Kalina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Mike
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or