2 Replies Latest reply on Apr 23, 2010 6:14 AM by jimmyoneshot

    Changing a combobox's SelectedIndex upon A Button Click

    jimmyoneshot Level 1

      This may sound simple but I'm having trouble implementing the code. I have a combox box in my app (categorySelectorDropdown) populated by an array collection which contains the property 'categoryid'. I also have a variable I've defined in my app called 'chosencategoryid', the value of which changes based on the clicking of other buttons/items in my app. I have a button which once clicked should make the combobox's selectedindex change to the particular index which has the same categoryid value as the chosencategoryid variable's value but I'm struggling to figure out the code


      I thought the click of the button would be something like:-


      categorySelectorDropdown.selectedIndex=(categorySelectorDropdown.selectedIndex WHERE categoryid == chosencategoryid);


      Except that obviously wouldn't work but that's the best way I can explain what I want it to do. Can anyone advise me on what the sysntax should be?