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

onChange Event Fires Incorrectly

1 Answer 75 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 28 Apr 2011, 12:40 PM
I have onChange events attached to several DropDownLists in a Grid using v2011.1.315 of the Telerik MVC Controls.

I've found that the DropDownList onChange events are firing incorrectly when unrelated dropdowns or buttons are clicked for the first time. After the initial mis-firing of each DropDownLists onChange event, subsequent onChange events fire correctly.

Attached is some sample code (based on code posted elswhere in this forum: http://www.telerik.com/community/forums/aspnet-mvc/grid/loadcontentfrom-ajax-binding-with-infinite-nested-grid-tabstrip.aspx).

To see the problem run up the attached code, click on the "Grid" tab, put one of the rows into edit mode, then click on any of the grid buttons or on one of the drop-downs to see the onChange events firing incorrectly.

The Editor Template code for the Title drop down is as follows (the code for the Name drop down is similar):
<%= Html.Telerik().DropDownList()
     .Name("Title")
     .BindTo(new SelectList((IEnumerable)ViewData["Titles"], "Id""Name"))
     .ClientEvents(events => events.OnChange("onChange_Title"))
%>

Interestingly, if the binding is changed as follows (i.e. the dataValueField binding is changed from Id to Name), the event firing problem goes away:
     .BindTo(new SelectList((IEnumerable)ViewData["Titles"], "Name""Name"))

Can anyone shed any light on what's going wrong here?

Regards,

Chris

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 28 Apr 2011, 04:49 PM
Hello Chris,

 Thank you for drawing our attention to this issue.

I confirm it as a bug, which I am glad to inform is already fixed. The fix will be included in the next official release of Telerik extensions for ASP.NET MVC.
For your convenience I have attached the modified JavaScript files.

As a gratitude for your cooperation I have updated your Telerik points.

Regards,
Georgi Krustev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
Chris
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or