Synchronizing multiple dropdownlists that use remote data

2 posts, 0 answers
  1. Josh
    Josh avatar
    1 posts
    Member since:
    May 2015

    Posted 11 Jan 2016 Link to this post

    I have two dropdown lists. Both are for the same object, but one dropdown is for the ID of the object while the other is for the name (so the user has multiple ways to search for it). It's a large list, so both use serverside filtering.

     Is there a way to join them so that when one is selected, the other auto populates? I've tried an event on close, select, and change, and then that javascript event reapplies the datasource so that it can be in the other dropdown of the same object. However, that means it can no longer be used for going to the server and getting the remote data after it's applied the new datasource.

     Any ideas?  

    Template for ID/Number

                            read.Action("GetAccountList", "Account"));
                    .Events(events =>
    Template for Name

    @(Html.Kendo().DropDownListFor(m => m)
                  .OptionLabel("Select account...")
                  .DataSource(source =>
                      source.Read(read => read.Action("Editing_Custom", "Contact"))
                  .Events(events =>

    Rough Draft of Javascript Function


    function _accountSyncronize()
        var accountSource = new{ data: [this.dataItem()] });

  2. Alexander Valchev
    Alexander Valchev avatar
    2887 posts

    Posted 13 Jan 2016 Link to this post

    Hi Josh,

    Instead of changing the dataSource you may simply set the widget's value through the API.

    Something like this:

    function onChange() {
      var dataItem = this.dataItem();
      var otherDropDown = /*get reference to the other dropdown */
      otherDropDown.value(; //or otherDropDown.value(

    After the ID is set the DropDownList will read its dataSource to get the dataItems and find the matching one.

    Alexander Valchev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top