Ajax bound drop down using parameter

1 posts, 0 answers
  1. carlg
    carlg avatar
    41 posts
    Member since:
    Jun 2012

    Posted 20 Sep 2012 Link to this post

    Here is my dropdown:

    @(Html.Kendo().DropDownList()
            .Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
            .DataValueField("TaxImpsnId")
            .DataTextField("TaxImpsnName")
            .DataSource(source =>
            {
                source.Read(read =>
                {
                    read.Action("_AjaxMethod", "MyController", new { lookupId= 1 });
                }).ServerFiltering(true);
            })
    )

    My dropdown is actually a column in a Kendo grid.  Instead of hard coding the lookupId =1 that is passed into the Ajax method in the controller, I want to take it from another field on the grid of the currently selected row.

    So when the user changes the row of the grid, the drop down should reload passing in the lookupId of the currently selected grid row to the controller.

    Thanks for the help.

Back to Top