0
votes

I have a MVC Kendo MultiSelect helper that I want to set up but NOT retrieve the data for until an external event if fired. Im using it in a cascading capacity with a drop down list and don't what to show any values to select until the dropDownList has a selected value. Everything is working fine except this one annoyance.

@(Html.Kendo().MultiSelect()
        .Name("productMultiSelect")
        .DataTextField("Name")
        .DataValueField("Id")
        .Filter(FilterType.Contains)
        .DataSource(source =>
        {
            source.Read(read =>
            {
                read.Action("GetProducts", "OrderProductAdmin3");
            });
        })

I tried setting the AutoBind property to false but the MultiSelect helper still did and initial DataBind.

I think I can use code like this to data bind it when the external event is fired

    var productMultiSelect = $("#productMultiSelect").data("kendoMultiSelect");
    if (!DataBound) {
        productMultiSelect.dataBind();
        DataBound = true;
    }

Thank you for your help.

Earl

1

1 Answers

0
votes

I'm just going to show and hide it as appropriate.