or
01.
@(Html.Kendo().Grid(Model.Charges)
02.
.Name("charges_grid")
03.
.Columns(columns =>
04.
{
05.
columns.Bound(charge => charge.Type)
06.
.Title("Charge Description");
07.
columns.Bound(charge => charge.Amount)
08.
.HtmlAttributes(new { @style = "text-align:right;" })
09.
.Width(100)
10.
.Title("Amount");
11.
columns.Command(command =>
12.
{
13.
command.Edit();
14.
command.Destroy();
15.
}).Width(175);
16.
})
17.
.BindTo(Model.Charges)
18.
.ToolBar(toolbar => toolbar.Create())
19.
.Editable(editable => editable.CreateAt(GridInsertRowPosition.Bottom))
20.
.DataSource(dataSource => dataSource
21.
.Ajax()
22.
.Model(model => model.Id(p => p.Type))
23.
.ServerOperation(false)
24.
.Create(update => update.Action("Create", "Home"))
25.
.Read(read => read.Action("Read", "Home"))
26.
.Update(update => update.Action("Update", "Home"))
27.
.Destroy(update => update.Action("Destroy", "Home"))
28.
))
01.
public class Shipment
02.
{
03.
// other data members
04.
public string Signed { get; set; }
05.
public string BundleId { get; set; }
06.
public float TotalAmountDue { get; set; }
07.
08.
public ICollection<
Charge
> Charges { get; set; }
09.
}
@(Html.Kendo().Grid<
Mallons.DomainFire.Models.Houses
>()
.Name("gridFcRevised")
.Columns(columns =>
{
columns.Command(command => command.Custom("View").Click("viewRevisedHouse")).Width("85px").HtmlAttributes( new {@data-actionurl=Url.Action('AjaxAdd', 'HouseFee', new {Oid = '#=Oid#'})}); //Error here
columns.Command(command => command.Custom("View").Click("viewRevisedHouse")).Width("85px"); // This works fine
columns.Bound(p => p.Oid).Visible(false);
columns.Bound(p => p.ApplicationDate).Format("{0:dd/MMM/yyyy}").Title("Application Date");
columns.Bound(p => p.RevisedHouseReason).Title("Revised Reason");
})
.Pageable()
.Sortable()
.Scrollable(s=>s.Height("auto"))
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Events(e => e.Error("handleAjaxError"))
.PageSize(10)
.Read(read => read.Action("RevisedHouses_GridRead", "House", new {originalHouseOid= Model.Entity.Oid }))
)
)