I am having an issue with passing additional parameters over a read function.
@(Html.Kendo().Grid<Wue.Web.Employee.Model.Models.DocumentLine>()
.Name("documentLinesGrid" + @Model.Document.DocumentNumber + "lines")
.Columns(col => {
col.Bound(c => c.VendorPartNumber).Title("Vendor Part Num");
col.Bound(c => c.Quantity);
col.Bound(c => c.Price);
}
)
.Scrollable()
.DataSource(ds => ds
.Ajax()
.Read(readLineData => readLineData.Action("GetLineData", "Document", new { currentDoc = Model.Document }))
)
.ColumnMenu()
)
On the Controller I have this as my action method:
public ActionResult GetLineData([DataSourceRequest] DataSourceRequest request, Document currentDoc) { }
The issue is that the data that is being sent is always null. I have tried to change the type to a string and passing currentDoc = "123" and having the action method accept a string currentDoc and that seems to work. Why will an object not pass through?
Note: I have also attempted to use js to send the information by using the .Data(functionName) and then in js using return { Html.Raw(Json.Encode(Model.Document)) but that returns null as well. Please help as I cannot get this to work.
@(Html.Kendo().Grid<Wue.Web.Employee.Model.Models.DocumentLine>()
.Name("documentLinesGrid" + @Model.Document.DocumentNumber + "lines")
.Columns(col => {
col.Bound(c => c.VendorPartNumber).Title("Vendor Part Num");
col.Bound(c => c.Quantity);
col.Bound(c => c.Price);
}
)
.Scrollable()
.DataSource(ds => ds
.Ajax()
.Read(readLineData => readLineData.Action("GetLineData", "Document", new { currentDoc = Model.Document }))
)
.ColumnMenu()
)
On the Controller I have this as my action method:
public ActionResult GetLineData([DataSourceRequest] DataSourceRequest request, Document currentDoc) { }
The issue is that the data that is being sent is always null. I have tried to change the type to a string and passing currentDoc = "123" and having the action method accept a string currentDoc and that seems to work. Why will an object not pass through?
Note: I have also attempted to use js to send the information by using the .Data(functionName) and then in js using return { Html.Raw(Json.Encode(Model.Document)) but that returns null as well. Please help as I cannot get this to work.