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

[Solved] Set selected DropdownList item by value

4 Answers 513 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.
Ron
Top achievements
Rank 1
Ron asked on 30 Dec 2010, 05:42 PM
How does one set the selected item in a dropdownlist given the value of an item in the dropdownlist?  I know I can do this given the index of a value, but I only have the value.

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 03 Jan 2011, 09:36 AM
Hello Ron,

 You can use value() method:

var dropDownList = $('#DropDownList').data('tDropDownList');
dropDownList.value('pass value');

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
0
shariq
Top achievements
Rank 1
answered on 19 Jan 2011, 02:12 AM
hello ,

     I got the same issue but its working fine but when i click on the list to show its rebinding and not showing the changed item name.
please tell me how to do this . thanks
0
Jeremy
Top achievements
Rank 1
answered on 27 Jul 2012, 08:37 PM
Georgi, Does that fire the OnChange event?

Thanks
0
Georgi Krustev
Telerik team
answered on 30 Jul 2012, 08:52 AM
Hello Jeremy,

 value("value") method does not raise change event. If you need to trigger change event you just need to trigger it manually:

dropDownList.trigger("change");

Kind regards,
Georgi Krustev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
ComboBox
Asked by
Ron
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
shariq
Top achievements
Rank 1
Jeremy
Top achievements
Rank 1
Share this question
or