Pre-filtering the dataset

Docs

The records in the dataset can be pre-filtered using the FixedFilterSql and FixedFilterParams properties. In this example only products that have not been discontinued are selected for editing.

Razor
                                
                                        
DbNetEditCore productsEdit = new DbNetEditCore("northwind","products");
productsEdit.Column("discontinued").DataType(typeof(Boolean));
productsEdit.Column("categoryid").Lookup(new Lookup("Categories", "CategoryID", "CategoryName")).Label("Category");
productsEdit.Column("SupplierID").Lookup(new Lookup("Suppliers", "SupplierID", "CompanyName")).Label("Supplier");
productsEdit.Column("UnitPrice").Style("background-color:gold; font-weight:bold;").Format("c");
productsEdit.FixedFilterSql = "discontinued = @discontinued";
productsEdit.FixedFilterParams["discontinued"] = false;
productsEdit.Insert = true;
@productsEdit.Render()