Multiple parameters from ComboBoxes

4 posts, 0 answers
  1. ryan
    ryan avatar
    3 posts
    Member since:
    Feb 2009

    Posted 11 Feb 2009 Link to this post

    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
  2. Stargazer
    Stargazer avatar
    73 posts
    Member since:
    Jan 2007

    Posted 26 Mar 2009 Link to this post

    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

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ryan
    ryan avatar
    3 posts
    Member since:
    Feb 2009

    Posted 26 Mar 2009 Link to this post

    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.
  5. Stargazer
    Stargazer avatar
    73 posts
    Member since:
    Jan 2007

    Posted 26 Mar 2009 Link to this post

    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... ;)
Back to Top