This question is locked. New answers and comments are not allowed.
Hi guys,
I am populating DropDownlist from server side and selects a specific item on client side, function selects required item properly
but does not update the value property so due to this OnChange client side event does not trigger for first time. Please take a look into this.
Client Code
I am populating DropDownlist from server side and selects a specific item on client side, function selects required item properly
but does not update the value property so due to this OnChange client side event does not trigger for first time. Please take a look into this.
@(Html.Telerik().DropDownList() .Name("DropDownList_ElegirMapa") .BindTo(new SelectList(Model.ElegirMapa, "Value", "Text")) .ClientEvents(events => events .OnChange("DropDownList_ElegirMapa_onChange") .OnLoad("DropDownList_ElegirMapa_OnLoad")) .HtmlAttributes(new { style = "width:400px" }) )Client Code
function DropDownList_ElegirMapa_OnLoad(e) { var staticItem = [{ Text: "Por favor Seleccionar", Value: "-1"}]; var ddlElegirMapa = $(this).data('tDropDownList'); ddlElegirMapa.data = $.merge(staticItem, ddlElegirMapa.data); ddlElegirMapa.select(0);}