Hello
I have a multiselect widget working in AutoBind mode. To speed up display, as long as the field is not changed, I would like to load the selected values using Autobind(false) and load the selected Items in .Value() as per the docs.
I have verified that Model.SelectedOwners contains the DataValues and Model.SelectedOwnersPreload contains a List of Items with Name / Id with the same DataValues.
If I set Autobind(true), the widget works as expected but is slow to read the full list of available items from the datasource.
If I set Autobind(false) the widget works correctly on first load of the page. However, when the Form posts back and is rendered again, the selected Values are no longer shown, even though I render the page through the same code as on initial load and in the View, both the Value List (Model.SelectedOwners) and the Item List (Model.SelectedOwnersPreload) provide the expected Values.
What am I missing?
Currently the Code is:
@(Html.Kendo().MultiSelectFor(m => m.SelectedOwners)
.DataTextField(
"Name"
)
.DataValueField(
"Id"
)
.Placeholder(StringResource.SoftwareItemOwnersPlaceholder)
.AutoBind(
true
)
.DataSource(source =>
{
source.Read(read =>
{
read.Action(
"GetAvailableOwners"
,
"SoftwareItem"
);
});
}).Value( Model.SelectedOwnersPreload)
)
Regards,
Erwin