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

Client-Side Methods Not Working

1 Answer 93 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 06 Jan 2009, 09:25 PM
Hello,

I tried programmably setting the selected index or value of the RadComboBox, but neither work.  I do:

combo.set_selectedIndex(0);  //doesn't do anything (has way more than zero items)

OR

var item = combo.findItemByValue("Value");  //returns actual instance
item.set_selectedItem(item);   //doesn't do anything

What do I have to do to update the display???  Is there an update method?  Or am I missing something.  Again, the combo has plenty of items and the findItemByValue returns a valid reference.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 07 Jan 2009, 09:34 AM
Hello Brian Mains,

Try the following JavaScipt for setting the RadComboBoxItem as selected.

JavaScript:
<script type="text/javascript"
function SetItemCombo() 
    var combo = $find("<%= RadComboBox1.ClientID %>");  
    var item = combo.findItemByText("ComboItem1"); 
    item.select(); 
</script> 

ASPX:
<telerik:RadComboBox ID="RadComboBox1" Runat="server" DropDownWidth="200px"  > 
<Items>          
    <telerik:RadComboBoxItem Text="ComboItem1" /> 
    <telerik:RadComboBoxItem Text="ComboItem2" /> 
    <telerik:RadComboBoxItem Text="ComboItem3" /> 
</Items> 
</telerik:RadComboBox> 
<input id="Button1" type="button" value="Reset Item" onclick="SetItemCombo();"/> 

Thanks,
Shinu.
Tags
ComboBox
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or