I am having trouble getting the multi select to work in a .NET 5 project. I believe the code below is the relevant portion. This is copied directly from the official Telerik demo with a few modifications, and it works in the official Telerik demo project. The problem is that I can't get this code to work in any other project. It seems to be unable to read the data coming from Virtualization_Read. Since this works fine in the demo project, I am thinking it must be something outside of the code shown below, but I have no idea what it could be.
@(Html.Kendo().MultiSelect()
.Name("orders")
.DataTextField("text")
.DataValueField("value")
.Placeholder("Select addresses...")
.Height(450)
.Filter("contains")
.DataSource(source =>
{
source
.Ajax()
.PageSize(10)
.Read("Virtualization_Read", "Home");
})
.Virtual(v => v.ItemHeight(26).ValueMapper("valueMapper"))
)
public ActionResult Virtualization_Read([DataSourceRequest] DataSourceRequest request)
{
return Json(GetOrders().ToDataSourceResult(request));
}
private List<SelectListItem> GetOrders()
{
var list = new List<SelectListItem>();
list.Add(new SelectListItem() { Text = "Item 1", Value = "1" });
list.Add(new SelectListItem() { Text = "Item 2", Value = "2" });
return list;
}