Config
public class OrderTable : MvcTable<Order>
{
public override void Configure(IStaticTableConfiguration<Order> config)
{
config.SetAction("ListOrders", "Northwind")
.SetCssClass("table table-striped")
.HiddenColumnFor(c => c.OrderID, cfg => cfg.Hide())
.ActionLinkColumn(c => c.Customer.City, "Category", "Home")
.DisplayForColumn(c => c.Shipper.CompanyName)
.DisplayForColumn(c => c.ShipRegion)
.DisplayForColumn(c => c.Order_Details[0].Quantity)
.ConfigurePagingControl(p => p.SetContainerCssClass("pagination").SetPageSizes(10, 20, 30));
}
}
Child Action
public ActionResult ListOrders(TableRequestModel request, FiltersModel model)
{
var entities = new NorthwindEntities(NorthwindServiceUrl);
var orders = entities.Orders.Expand(o => o.Customer).Expand(o => o.Shipper).Expand(o => o.Order_Details);
return TableResult.From(orders).Build<OrderTable>(request);
}