Posted 01 May 2013
Link to this post
I'm not sure if this is a bug or if this is the way it's supposed to be, but if you set the selected index, then change the selected value of a combobox, the combobox does not select that value, but instead changes the value of the currently selected index. I would think changing the selected value would have the combobox select the item with that value instead of changing the value of the currently selected item. I can also see how it might go the other way so you can change the value of the selected item, but it seems more useful if the combobox actually selected the value you set in selected value. Or did i just do something wrong?
I guess here's my specific question, I have two radcombobox's. when the page loads, i first set the selected index to 0, then check to see if i need to select a specific item in the lists. if i do, i set the selected value of the radcombobox's to the value of that item. however, every time in the codebehind when i try to get the value of the selected item, it always gives me the value of the item at 0 (unless i set the selected value, which it will give me that value instead, even if i haven't changed the selected item).
anyway, if that makes any sense, i actually fixed the problem by not setting the selected index at all (since i was setting it to 0 anyway).
update: nope, there's still a problem. setting the selected value does not show as the selected item in the combobox, although i am now getting the correct selected value in the code behind, when i refresh the window, the "selected item" is the first item in the list. but if i pull down, it shows the correct selected item highlighted
update 2: sorry, the problem was because EnableLoadOnDemand was set to true, now it works fine (stupid... i've been trying to figure this out the last day and a half, and now that i decide to register to this site to post this problem, i fix it before i even get a response, haha)