I'm re-posting this as a separate issue from the one I've been working on with Petur. I have a kendo grid, actually a sub-grid, for which I've defined a command button. In the button I need to use a property from the master grid, which is no problem, and a property from the current row of the sub-grid where the button will be clicked. The syntax for this is not working out, and I have not been able to find an example either of multiple parameters, nor of using a property of the current row in such a manner. I get an error that the current row property is not defined when the page renders. I need to sent both properties to the controller which will redirect to the proper CRUD view. I've tried two different syntaxes. Code is shown below. The first example will render but lacks the critical second property. Petur has a sample project from me that these buttons could be dropped into for you to see the problem. The project is called TriLevel PolymorphicGridTest.
@model IEnumerable<
kendoBatchHeaderTest.Models.BatchHeader
>
@{
ViewBag.Title = "Transaction Review";
}
<
h2
>Batches to Review/Post</
h2
>
@(Html.Kendo().Grid(Model)
.Name("BatchGrid")
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:700px" })
.Columns(columns =>
{
columns.Bound(b => b.BatchID)
.Width("100")
.Title("Batch ID");
columns.Bound(b => b.Created_DTTM)
.Width("175")
.Format("{0:MM/dd/yyyy hh:mm tt}")
.Title("Created");
columns.Bound(b => b.PostingStatus)
.Width("175")
.Title("Status");
}
)
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(40)
.Read(read => read.Action("FetchBatchCollection", "Home"))
)
.ClientDetailTemplateId("transactions")
//.Events(events => events.DataBound("dataBound"))
)
<!-- Nested grid for transaction object, member of BatchHeader.TranCollection
There can be many ITransaction objects per BatchHeader -->
<
script
id
=
"transactions"
type
=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<
kendoBatchHeaderTest.Models.Transaction
>()
.Name("TranGrid_#=BatchID#") // makes the sub-grid name unique so that it will be displayed on each child row.
//.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:175px; width:800px" })
.Columns(columns =>
{
columns.Template(@<
text
></
text
>)
.ClientTemplate("<
a
href='" +
Url.Action("Edit", "Home") +
"/#=BatchID#'>Edit</
a
>")
.Width("100px");
columns.Template(@<
text
>@Html.ActionLink("View Details", "Edit", "Home",
new { BatchID = "#=BatchID#", TransactionID = "=#TransactionID#" }, null)</
text
>)
.Width("100px")
.ClientTemplate("<
a
href='/Edit/Home/#=BatchID#/=#TransactionID#</a>");
columns.Bound(b => b.TransactionID)
.Width("100")
.Title("Transaction ID");
columns.Bound(b => b.TranactionType)
.Width("200")
.Title("Type");
columns.Bound(b => b.PostingMessage)
.Width("600")
.Title("Posting Message");
}
)
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.Read(read => read.Action("FetchTransactionCollection", "Home", new { batchID = "#=BatchID#" }))
)
//.ClientDetailTemplateId("detailTransactions")
//.Events(events => events.DataBound("dataBound"))
.ToClientTemplate()
)