Hi, I need help to set a default value (the value is a filter for my grid) on DropDownList after the databound runs a function.
@(Html.Kendo().DropDownList()
.Name("gridOptionsDDL")
.OptionLabel(@SharedLocalizer[ResourceKeys.NoFilterSelected].Value)
.DataTextField("OptionsName")
.DataValueField("Id")
.AutoBind(false)
.Events(e => e.DataBound("loadStandardFilter").Change("onGridOptionsChange").Open("onGridOptionsDDLOpen"))
.HtmlAttributes(new { @class = "filter-dropdown" })
.DataSource(ds =>
{
ds.Read(read => read.Action("GetGridOptions", "InventoryData").Data("GetGridOptionsGridName"));
})
.ToClientTemplate()
my js-file:
function loadStandardFilter(e) {var dropDownList = $("#gridOptionsDDL").data("kendoDropDownList");;
dropDownList.select(function (dataItem) {
return (dataItem.Standard === true);
})
dropDownList.trigger("change");
}
Hi Maximilian,
I noticed there is a duplicate support ticket created by you which addresses the same issue. Please continue any conversation within the support thread to keep communication in one place.
Thank you for you understanding in the matter.
Regards,
Patrick | Technical Support Engineer, Senior
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.