Hello Team,
I am using one kendo dropdown control inside a form. While submitting the form value is properly binding. But when I am opening an existing form for editing, kendo dropdown is not showing the value which it is fetching from database.
In side view dropdown control---
<input id="AssignedTo" class="form-control" style="width: 250px;" />
<script type="text/javascript">
$(document).ready(function () {
$("#AssignedTo").kendoDropDownList({
autoBind: false,
filter: "contains",
dataTextField: "FullName",
dataValueField: "StaffID",
optionLabel: "Search by first or last name",
dataSource: {
serverFiltering: true,
pageSize: 80,
transport: {
read: {
url: "/Test/Staff/Search"
}
}
},
value: '@Model.StaffID'
});
})
So what is happening right now, when I am editing the form, the dropdown show "Search by First or last name", but when we expand the options, the expected option is already selected but the dropdown text is not set.
Attached the screenshots of the control.
Please provide solution to display the selected value when the form gets loaded.
Thanks
Amrendra
Hi Amrendra,
Could you please try to set the autoBind option to true and check if this will resolve the issue?
- https://docs.telerik.com/kendo-ui/api/javascript/ui/combobox/configuration/autobind
Regards,
Neli