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

Multiple parameters from ComboBoxes

3 Answers 89 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ryan
Top achievements
Rank 1
ryan asked on 11 Feb 2009, 05:06 PM
I see in an example with the RadComboBox that someone can pick from a list of continents, then a list of countries and then a list of cities.  Each of these request uses e.Text to get the current value.  I need to be able to get not only the e.Text of the selected item but also the other combobox.  For example, a person selects an item from a list, it loads all the items where that item is found in another combobox, when they then select from the 2nd combobox I need to get the value of both the comboboxes, the one the person has just selected and the 1st one.  When I try to get the text on the first item it only shows me the item at position 0 which is a selection message.

How can I get the value from the 1st combobox and the 2nd to then load the 3rd with the value from the first 2?

Thanks

3 Answers, 1 is accepted

Sort by
0
Stargazer
Top achievements
Rank 2
answered on 26 Mar 2009, 12:11 PM
Hello All!

Exactly the same problem here. In my case, I have 4 Combos, which one being populated (server side) from the Database, via DataBinding, using the e.Text from the previous ComboBox. It all works well, for all the 4 combos.

Example:

Combo Semesters
Combo Courses -> Filtered with the selected Semester
Combo Classes -> Filtered with the selected Semester AND the selected Course
Combo Subjects -> Filtered with the selected Semester AND the selected Course AND the selected Class

After all this I have a "Go" button which needs to get all 4 combos selections, and execute a query using those values as parameters, which works like a charm, no problems accessing the selections of the 4 combos.

What I'm not being able to do is to get the selected Semester in the Classes combo. Also I can not get the selected Semester and the selected Class in the Subjects combo...

I'm without a clue... And I'm guessing this will be, probably, a simple case... :S

0
ryan
Top achievements
Rank 1
answered on 26 Mar 2009, 02:06 PM
find the control on the page you want like:

var thecombo1 = $find("<%= thecombo .ClientID %>");
var item = eventargs.get_item();

 var thecombo2= $find("<%= thecombo2.ClientID %>");
        var item2 = combo._callbacktext;

then do a request on that:

thecombo1 .requestItems(item2 + "|" + item.get_value());

The goal is to pass back the items from the page concatenated as a string and then split them in the server side code on a character like the pipe symbol.  This is how I got it to work, not the best way but it worked.
0
Stargazer
Top achievements
Rank 2
answered on 26 Mar 2009, 02:41 PM
Hello Ryan, thanks!

I've got it to work using context. I figured out the solution after reading the this post. It worked just fine. Nevertheless, I'm like you... Not sure if this is the best and the most elegant way of doing things... ;)
Tags
ComboBox
Asked by
ryan
Top achievements
Rank 1
Answers by
Stargazer
Top achievements
Rank 2
ryan
Top achievements
Rank 1
Share this question
or