I tried this but from my controller data is returning but not binding to kendo grid This is my controller
public ActionResult Index(string LocationId)
{
using (var client = new HttpClient())
{
IList<AssetsByLocation> _assetCompanyDetailslist;
AssetRepository assetrep = new AssetRepository();
Guid LocationID = new Guid();
if (Request.Params["LocationId"] != null)
{
LocationID = new Guid(Request.Params["LocationId"].ToString());
_assetCompanyDetailslist = assetrep.GetAssetsForLocation(LocationID);
var model = _assetCompanyDetailslist;
return View(model);
}
else
{
return View();
}
}
}
in my .cshtml kendo grid i used this to read
.Read(read => read.Action("Index", "AssetByLocation").Data("getMsgType"))
This is my event in dropdownlist
.Events(events => events.Change("OnMsgTypeChange"))
There are my functions
var ddlItem;
function getMsgType() {
return {
LocationId: ddlItem
}
}
function OnMsgTypeChange(e) {
ddlItem = this.value();
$("#Grid").data("kendoGrid").dataSource.read();
}