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?
8 Answers, 1 is accepted
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

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" />

Hi again
I've found out I'm using Telerik version 2015.2.623.45
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

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.
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

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.
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