Razor
DbNetGridCore productsGrid = new DbNetGridCore("northwind", "Products")
{
Columns = new List() { "ProductID", "ProductName", "SupplierID", "CategoryID", "QuantityPerUnit", "UnitPrice", "UnitsInStock", "UnitsOnOrder", "ReorderLevel", "Discontinued" },
Labels = new List() { "ID", "Name", "Supplier", "Category", "Quantity", "Price", "Stock", "On Order", "Reorder Level", "Discontinued" },
PageSize = 10,
BooleanDisplayMode = BooleanDisplayMode.Checkbox,
};
productsGrid.Column(new String[] { "ProductID", "ProductName", "SupplierID", "CategoryID", "QuantityPerUnit", "UnitPrice", "UnitsInStock", "UnitsOnOrder", "ReorderLevel", "Discontinued" }).Filter();
productsGrid.Column("SupplierID").Lookup(new Lookup("Suppliers", "SupplierId", "CompanyName"));
productsGrid.Column("CategoryID").Lookup(new Lookup("Categories", "CategoryId", "CategoryName"));
productsGrid.Column("UnitPrice").Format("c");
productsGrid.Column("CategoryID").FilterMode(FilterMode.List);
productsGrid.Column("Discontinued").DataType(typeof(Boolean));
@productsGrid.Render()