Config
public class InvoiceTable : MvcTable<Invoice>
{
public override void Configure(IStaticTableConfiguration<Invoice> config)
{
config
.SetAction("ListInvoices","Northwind")
.SetCssClass("table table-striped")
.SetDefaultSortColumn(m => m.Salesperson, true)
.DisplayForColumn(m => m.ProductName)
.DisplayForColumn(m => m.Quantity)
.DisplayForColumn(m => m.Region)
.DisplayForColumn(m => m.Salesperson)
.EditorForColumn(m => m.Discount);
}
}
Child Action
public ActionResult ListInvoices(TableRequestModel request)
{
var entities = new NorthwindEntities(NorthwindServiceUrl);
return TableResult.From(entities.Invoices).Build<InvoiceTable>(request);
}