これを試しましたが、コントローラーからデータが返されますが、剣道グリッドにバインドされていません これは私のコントローラーです
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();
}
}
}
私の.cshtml剣道グリッドで、これを使って読んだ
.Read(read => read.Action("Index", "AssetByLocation").Data("getMsgType"))
これはドロップダウンリストの私のイベントです
.Events(events => events.Change("OnMsgTypeChange"))
私の機能があります
var ddlItem;
function getMsgType() {
return {
LocationId: ddlItem
}
}
function OnMsgTypeChange(e) {
ddlItem = this.value();
$("#Grid").data("kendoGrid").dataSource.read();
}