0
votes

In my Kendo grid, I've two dropdownlists (user IDs and user names). Based on the selection in one of the list, I'd like to change the selected value in the other. This is not a case of cascading drop down lists, since both lists are already populated with a one-to-one relationship, and selecting a value in the first list doesn't repopulate the second list with new data.

While adding a new record, if the user selects a user ID, I want the corresponding user name to be selected in the user name drop down, and if the user selects a user name, I want the corresponding user id to be selected in the user ID drop down list.

How can this be done?

1

1 Answers

0
votes

One way would be to register an onChange event:

.Events(e =>
{
    e.Change("onChange");
})

In the corresponding onChange JavaScript function you can implement your desired logic.

In JavaScript you can then access the other DropDownList:

var dropdownlist = $("#yourListId").data("kendoDropDownList");
dropdownlist.select(index);

You can find an example here