MVC Kendo Grid read.Action().Data(function) not called on a forced datasource.read()

Brooke

Our code has two dropdowns. When the `onchange()` for the first fires it calls `$("#classDropDown").data("kendoDropDownList").dataSource.read();` to force the second one to update.

<%: Html.Kendo().DropDownList().Name("speciesDropDown")

.DataTextField("Text")

.DataValueField("Value")

.DataSource(source =>

{

source.Read(read =>

{

read.Action("GetNLSSpecies", "RefData").Data("noFilters");

});

})

.HtmlAttributes(new { style = "width: 50%" })

.Filter(FilterType.Contains)

%>

...

<%: Html.Kendo().DropDownList().Name("classDropDown")

.DataTextField("Text")

.DataValueField("Value")

.DataSource(source =>

{

source.Read(read =>

{

read.Action("GetClassData", "RefData").Data("mergeData()");

});

})

.HtmlAttributes(new { style = "width: 50%" })

.Filter(FilterType.Contains)

%>

Elsewhere ...

$('#speciesDropDown').on('change', function (event) {

...

$("#classDropDown").data("kendoDropDownList").dataSource.read();

}

The `mergeData()` function is called to provide data from the Javascript to the server. The **problem** is that because I'm calling this as a function it is **NOT** called during the `dataSource.read()`. But it is called initially when the page first loads.

Obviously I could change this to `mergeData` (ie. not a function) but it is the simplest case. I'm actually trying to pass arguments, something like:

Stefan

The described result is expected because the Data method is expecting a string name leading to the function. Passing a function when the Grid is expecting the name of the function is not supported as it differs from the expected value of the Data method:

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.