Add values to MultiSelect from Grid select

2 posts, 1 answers
  1. Shehab
    Shehab avatar
    8 posts
    Member since:
    Mar 2014

    Posted 25 Aug 2014 Link to this post

    I have a multiselect that works very well:
    @(Html.Kendo().MultiSelectFor(model => model.SurgeryMultiSelect).Filter("contains")
        .Placeholder("Select Procedure(s)...")
        .DataSource(source =>
              source.Read(read =>
                  read.Action("GetAllProcedures", "CommonJsonActions");
        .Events(e =>
    I also have a grid with a select option that will call a js function; in this function I want to add the selected value from the grid to the select items in the multiselect, if it doesn't already exist. Then call the change event in the multiselect if anything new is added.

    Any help will be appreciated.
  2. Answer
    Daniel avatar
    2173 posts

    Posted 27 Aug 2014 Link to this post

    Hello Shehab,

    You can use the value method to set the currently selected values e.g.
    function addItemToSelection(item) {
        var multiselect = $("#SurgeryMultiSelect").data("kendoMultiSelect");
        var value = multiselect.value();
        if (value.indexOf(item.ProcedureTypeId) == -1) {
            //in case the multiselect dataSource is currently filtered
            value = value.slice(0);


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top