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

RadComboBox - select value in Javascript

1 Answer 615 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dave Hollen
Top achievements
Rank 1
Dave Hollen asked on 22 Mar 2011, 10:13 PM
Hello,

I am using a RadComboBox on an Ajax Modal Popup Extender.

What I am attempting to do is to select a specific item in the combo box and have that item displayed as the selected item in the combo box.  Prior to displaying the popup that contains the combo box, the combo box is populated and I know the Value of the item that I want to select.

Here is the javascript I am using:

rcbSearchOffices.trackChanges();

rcbSearchOffices.set_value(defaultOfficeId.value);

 

var

item = rcbSearchOffices.findItemByValue(defaultOfficeId.value);

 

 

rcbSearchOffices.set_selectedItem(item);

 

rcbSearchOffices.updateClientState();

rcbSearchOffices.commitChanges();


However, when the combo box is displayed, the item that I am trying to select is not visibly selected unless I click on the combo box.  If I click on the combo box, I am automatically taken to that item.  What I want to happen is that the item is automatically displayed as the selected item in the combo box.

How do I do this?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Mar 2011, 11:04 AM
Hello,


I am not sure about the issue that you are facing. Maybe another option for selectng an item in the RadComboBox will do the trick for you. Give a try by calling the select() method of RadComboBoxItem client object instead of calling set_selectedItem().


rcbSearchOffices.trackChanges();
    .  .  .

var item = rcbSearchOffices.findItemByValue(defaultOfficeId.value);
item.select();
rcbSearchOffices.commitChanges();



Thanks,
Princy.
Tags
ComboBox
Asked by
Dave Hollen
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or