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

RadCombobox onClientIndexChanged without selected index changed

8 Answers 77 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
RMM
Top achievements
Rank 1
RMM asked on 12 Aug 2015, 06:34 AM

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

Sort by
0
Ivan Danchev
Telerik team
answered on 17 Aug 2015, 06:34 AM
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
0
RMM
Top achievements
Rank 1
answered on 17 Aug 2015, 07:16 AM

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

0
RMM
Top achievements
Rank 1
answered on 18 Aug 2015, 12:21 PM

Hi again

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

0
Ivan Danchev
Telerik team
answered on 18 Aug 2015, 02:27 PM
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
0
RMM
Top achievements
Rank 1
answered on 19 Aug 2015, 09:39 AM

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.

0
Ivan Danchev
Telerik team
answered on 21 Aug 2015, 03:34 PM
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
0
RMM
Top achievements
Rank 1
answered on 24 Aug 2015, 07:26 AM

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.

0
Ivan Danchev
Telerik team
answered on 25 Aug 2015, 03:57 PM
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
Tags
Ajax
Asked by
RMM
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
RMM
Top achievements
Rank 1
Share this question
or