Razor
DbNetGridCore ordersGrid = new DbNetGridCore("northwind", "orders", "ordersGrid")
{
Columns = new List() { "OrderID", "CustomerID", "EmployeeID", "OrderDate", "RequiredDate", "ShippedDate", "ShipVia", "Freight" },
Labels = new List() { "Order ID", "Customer ID", "Employee", "Date Ordered", "Date Required", "Date Shipped", "Ship Via", "Freight" },
PageSize = 10
};
ordersGrid.Column("CustomerID").Lookup(new Lookup("Customers", "CustomerId", "CompanyName")).GroupHeader();
ordersGrid.Column("EmployeeID").Lookup(new Lookup("Employees", "EmployeeId", "lastname + ',' + firstname"));
ordersGrid.Column("ShipVia").Lookup(new Lookup("Shippers", "ShipperId", "CompanyName"));
@ordersGrid.Render()
DbNetGridCore customersGrid = new DbNetGridCore("northwind", "customers", "customersGrid")
{
Columns = new List() { "ContactName", "ContactTitle", "Address", "Region", "PostalCode", "Phone", "Fax", "Country", "City" },
PageSize = 10
};
customersGrid.Column(new String[] { "Country", "City" }).GroupHeader();
@customersGrid.Render()