This question is locked. New answers and comments are not allowed.
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):
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:
Can anyone shed any light on what's going wrong here?
Regards,
Chris
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