RadCombobox onClientIndexChanged without selected index changed

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

    Posted 12 Aug 2015 Link to this post

    Hi

    I've noticed that the onClientIndexChanged event on RadComboboboxes fires even though the selected index hasn't changed.

    F.ex, if I open the dropdownlist of one RadComboboxes, close it again without selecting anything, and open the dropdownlist of another RadCombobox, the event fires on the first RadCombobox.

    Is it really supposed to do that, or is it a bug?

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 17 Aug 2015 Link to this post

    Hello,

    I am afraid I was not able to reproduce the issue with the latest version of the controls. Which version do you notice this behavior with? In order for us to get an idea of your configuration could you please post both RadComboBox markup declarations?

    Regards,
    Ivan Danchev
    Telerik
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. RMM
    RMM avatar
    11 posts
    Member since:
    Sep 2014

    Posted 17 Aug 2015 in reply to Ivan Danchev Link to this post

    Hi

    I don't know what version I'm running.

    My mark up looks like this:

    <label id="_grandparent1_lblDefaultText">grandparent1</label>
    <telerik:RadComboBox CssClass="MyClass" EmptyMessage="Empty..." OnClientSelectedIndexChanged="IndexChanged" OnClientSelectedIndexChanging="IndexChanging" ID="grandparent1_ddlCombobox" runat="server" EnableLoadOnDemand="false" AllowCustomText="false" MarkFirstMatch="false" Filter="Contains" DropDownAutoWidth="Enabled" Visible="True" />
    <label id="_grandparent2_lblDefaultText">grandparent2</label>
    <telerik:RadComboBox OnClientSelectedIndexChanged="IndexChanged" OnClientSelectedIndexChanging="IndexChanging" ID="grandparent2_ddlCombobox" runat="server" EnableLoadOnDemand="false" AllowCustomText="false" MarkFirstMatch="false" Filter="Contains" DropDownAutoWidth="Enabled" Visible="True" />

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

    Posted 18 Aug 2015 in reply to RMM Link to this post

    Hi again

    I've found out I'm using Telerik version 2015.2.623.45

  6. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 18 Aug 2015 Link to this post

    Hello,

    I noticed that you are using the same handlers (IndexChanging and IndexChanged) to handle the corresponding events of both RadComboBox. However that is not an issue and at my side the events are fired correctly (including with version 2015.2.623), as you can see in the linked video. A message with the ID of the ComboBox is displayed to indicate which one of the two controls fired the event.

    Regards,
    Ivan Danchev
    Telerik
    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
  7. RMM
    RMM avatar
    11 posts
    Member since:
    Sep 2014

    Posted 19 Aug 2015 in reply to Ivan Danchev Link to this post

    I'm been doing some further investigation and it turns out that the problem occours if I change the selected item of the comboboxes in jQuery.

    Ofcourse, I would expect the ClientIndexChanged event to be fired in such case, but the reaction seems to be delayed and when I check in the ClientIndexChanging handler, I see that it also fires when the old index and the new index are the same.

  8. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 21 Aug 2015 Link to this post

    Hello,

    Selection on the client can be done with the ComboBox client-side API. Could you demonstrate how you perform the selection and the handlers you do it in? We can test your scenario and check whether this is unexpected behavior or it is the default one and the ComboBox acts according to its design.

    Regards,
    Ivan Danchev
    Telerik
    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
  9. RMM
    RMM avatar
    11 posts
    Member since:
    Sep 2014

    Posted 24 Aug 2015 in reply to Ivan Danchev Link to this post

    Hi

    I'm using this function

    function RadSetSelectedValue(radCombo, selectedValue) {
    radCombo.trackChanges();
    radCombo.clearSelection();
    var item = radCombo.findItemByValue(selectedValue);
    item.select();
    radCombo.set_text(item.get_text());
    radCombo.set_value(item.get_value());
    item.set_visible(true);
    radCombo.updateClientState();
    radCombo.commitChanges();
    }

    I've noticed than the select function only changes the selectedIndex, but neither selectedItem nor value or text.

  10. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 25 Aug 2015 Link to this post

    Hello,

    Where do you call RadSetSelectedValue() and what value do you pass with the parameter "selectedValue"?
    I called your function from a RadButton's handler passing different Item values with the parameter "selectedValue", including the currently selected ComboBox Item's value, and it worked correctly, the item with the corresponding value was selected and the IndexChanged event fired. 

    Regards,
    Ivan Danchev
    Telerik
    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
UI for ASP.NET Ajax is Ready for VS 2017