Hi,
I am trying to accomplish what I thought was a relatively simple task - programmatically setting the selected item, and I cannot get it to work.
Prior to my user attempting to change the selection in the combobox, I have to check whether they are allowed to or not (they may not have filled in everything required for example), so I have hooked up the OnClientSelectedIndexChanging event and am checking if they can change the selection or not in this event. If they are not allowed to change, I am saving the index of the item they requested, cancelling the selectionchanging event and prompting them. If they choose a certain answer I wish to allow the new selection to be allowed so then try to select the index of the item they originally selected. I have tried this the following ways:
Both correctly set the selected index/item of the combobox, but neither actually change the combobox to the respective item - it is left displaying the original item. What am I missing?
Thanks in advance.
I am trying to accomplish what I thought was a relatively simple task - programmatically setting the selected item, and I cannot get it to work.
Prior to my user attempting to change the selection in the combobox, I have to check whether they are allowed to or not (they may not have filled in everything required for example), so I have hooked up the OnClientSelectedIndexChanging event and am checking if they can change the selection or not in this event. If they are not allowed to change, I am saving the index of the item they requested, cancelling the selectionchanging event and prompting them. If they choose a certain answer I wish to allow the new selection to be allowed so then try to select the index of the item they originally selected. I have tried this the following ways:
pageList.set_selectedIndex( pageIndexToLoad ); |
pageList.set_selectedItem( pageList.get_items().getItem( pageIndexToLoad ) ); |
Both correctly set the selected index/item of the combobox, but neither actually change the combobox to the respective item - it is left displaying the original item. What am I missing?
Thanks in advance.