RadCombobox cannot set selectedIndex in jQuery

4 posts, 0 answers
  1. RMM
    RMM avatar
    11 posts
    Member since:
    Sep 2014

    Posted 11 Aug 2015 Link to this post


    I'm trying to use jquery to update a RadCombobox and set its selected index by using RadComboboxItem.Select().

    The updating works fine, but when I use RadComboboxItem.Select() where RadComboboxItem.get_index()=0, RadCombobox.get_selectedIndex() returns the old index.

    If RadCombobox.get_index()>0 it works fine.


     function SetSelection(radCombo, selectedValue) {
    var item = radCombo.findItemByValue(selectedValue);
    if (item != null) {
    alert("id=" + radCombo.get_id() + " item.index=" + item.get_index());
    alert("id="+radCombo.get_id()+" selectedValue="+selectedValue+" index=" + radCombo.get_selectedIndex());


  2. RMM
    RMM avatar
    11 posts
    Member since:
    Sep 2014

    Posted 11 Aug 2015 Link to this post

    Hi Again.

    I've just found out, get_selectedIndex is not working when RadComboboxItem.get_index()>0 either.

    Or could it be RadComboboxItem.select() that isn't working?

  3. RMM
    RMM avatar
    11 posts
    Member since:
    Sep 2014

    Posted 12 Aug 2015 Link to this post

    I've found the answer myself.

    The index was prevented from changing because I had an onClientIndexChanging handler with args.set_cancel(false), if I was handling the clientIndexChange of another RadComboBox.

  4. Eyup
    Eyup avatar
    3296 posts

    Posted 13 Aug 2015 Link to this post

    Hello Rene,

    I'm glad you've managed to root out the problem by yourself. Please note that in such cases, it is of tremendous help to disable any AJAX on the page if present (RadAjaxManager, RadAjaxPanel, UpdatePanel, etc.). Then you can enable your script debugger (FireBug or F12) to see whether there are any errors interfering. When AJAX is enabled, the errors are being hidden or encapsulated, which may lead to omission.

    For additional client-side examples using the Telerik API, you can refer to our documentation articles:

    Hope this helps.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top