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

DropDownList - OnChange Event

2 Answers 158 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.
Jigar
Top achievements
Rank 1
Jigar asked on 10 Sep 2010, 07:44 PM
Hi There,

I recently observed that When I populate DropDownList with List, it doen't fire Onchange event. But If I bind it with Id and value list it does fire the event.

For Ex.

List Binding
Dim myList as List(Of String)
myList.Add("One")
myList.Add("Two")
myList.Add("Three")
Return New JsonResult With {.Data = New SelectList(myList)}
In above case, Event won't be fired.

With Id and Value Binding.
Dim myList As New List(Of Object)
myList.Add(New With{.id=1, .name="One"})
myList.Add(New With{.id=2, .name="Two"})
myList.Add(New With{.id=3, .name="Three"})
Return New JsonResult With {.Data = New SelectList(myList, "id", "name")}

In above case, Event gets fired.

why event is not being fired when i return list??

Thanks,

Jigar.

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 13 Sep 2010, 09:07 AM
Hello Jigar,

This is a known issue, which is already fixed. Currently if you bind DropDownList / ComboBox to collection of SelectListItem / DropDownItem object, without setting Value property, compontent will not raise OnChange event. I will suggest you set Value property in order to avoid this erroneous behavior.
As I said, this problem is already fixed and the fix will be included in the next official release of the Telerik Components for ASP.NET MVC.

Greetings,
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
0
Jigar
Top achievements
Rank 1
answered on 14 Sep 2010, 05:12 PM
Hi Georgi

thanks a lot for you reply.

Regards,

Jigar.
Tags
ComboBox
Asked by
Jigar
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Jigar
Top achievements
Rank 1
Share this question
or