After upgrading from 2013.1 from 2012.3, when I bind a source to a drop down list, there is not a selected item in the list anymore. I created two js fiddles which show this.
This first one is using 2012.3, note that the drop down list has Item1 selected by default:
http://jsfiddle.net/m4LPB/2/
This one is using 2013.1, note that the drop down list does NOT have an item selected:
http://jsfiddle.net/2FHsV/1/
Also, it appears that 2013.1 ignores anything I add to a data-index attribute on the select tag, where it should set the default item.
Thanks
12 Answers, 1 is accepted
We introduced some improvements/bug fixes releted to the MVVM binding and cascading functionality of the DropDownList widget. The problem in this case is related to а specific SELECT behavior, which does not select an item when options are added manually. Currently, you can overcome this issue using the data-value attribute like this:
<select ... data-value=
"Item 1"
>
I updated your Telerik points, because of the involvement.
Regards,
Georgi Krustev
the Telerik team

This is the code:
@Html.Kendo().DropDownListFor(model => model.IsActive)
.DataTextField("Text")
.DataValueField("Value")
.BindTo(new[]
{
new SelectListItem { Text = "Yes", Value = "True" },
new SelectListItem { Text = "No", Value = "False" }
});
What do I need to do to get this working again?

@Html.Kendo()
.DropDownListFor(m => m.IsActive)
.DataTextField("Text")
.DataValueField("Value")
.DataSource(source => source.Read("GetYesNoValues", "Kendo"))
Thanks,
Mike
I will suggest you download the latest internal build of Kendo UI and give it a try. Let me know if the problem still persists.
Georgi Krustev
the Telerik team

Is there a way that I can just install the DropDownList component of the internal build?
Thanks,
Mike
Upgrading only part of the release is not supported, as it may trigger unexpected issues (i.e. if a bug fix spans across multiple files). You can use the Visual Studio extension for Kendo UI to make the upgrade process fast and simple.
Regards,Alex Gyoshev
the Telerik team

Is this bug fixed?
I tried 2013.2.716, but still it doesn't work.
Best regards
Serkan
I believe that the problem was addressed in the official release of Kendo UI. Check this jsBin demo for reference.
Georgi Krustev
Telerik

I am uploading a sample project to show the bug.
Firstly please click "Normal" link. You will see a selected item called "Serkan".
After that please click "Bug" link. You will see no item is going to be selected in dropdownlist.
Best regards
Serkan
Thank you for the test project. I noticed GetYesNoValues Action method returns values which has lower case letters. On the other hand bool variable in .NET is searialized in "PascalCase". In other words the widget has values with "true"/"false" values and its value is "True", which are not equal. In order to address this you will need to fix the casing of GetYesNoValues values:
public
ActionResult GetYesNoValues()
{
var list =
new
List<SelectListItem>() {
new
SelectListItem() {
Text =
"Yes"
,
Value =
"True"
},
new
SelectListItem() {
Text =
"No"
,
Value =
"False"
}};
return
Json(list, JsonRequestBehavior.AllowGet);
}
Georgi Krustev
Telerik

Thanks for your quick reply.
I attached another sample project.
Please click Bug link and click edit button in grid.
You will see dropdownlist which doesn't set selected value.
Regards
Serkan
Thank you for the test project. The DropDownList does not select correct value, because the Grid widget is bound to a list of JSON where boolean properties are serialized as boolean and not like a string. On the other hand, the DropDownList widget is bound to a list of SelectListItem where values are strings. As you probably know "True"/"true" is different than true. You can handle this difference wiring the edit event of the grid and manually set the widget. Other option is to use custom model instead of SelectListItem, which will be serialized as the Grid's data. Check the attached achieve for more information about the first approach.
Georgi Krustev
Telerik