Editing The Grid

Docs

A grid can be made editable vis the edit dialog by setting the Update, Insert properties. The Edit control is an instance of DbNetEdit and can be configured independently using the EditControl property. The sample also uses the OnFormElementCreated event to customise the Notes textarea.

Razor
                                
                                        
DbNetGridCore employeesGrid = new DbNetGridCore("northwind", "employees");
employeesGrid.Column("ReportsTo").Lookup(new Lookup("employees", "employeeid", "lastname + ', ' + firstName"));
employeesGrid.Update = true;
employeesGrid.Insert = true;
employeesGrid.Navigation = false;
employeesGrid.Column(new string[] { "notes", "photo","photopath" }).Hidden();
employeesGrid.Column("country").Lookup(typeof(CountryEnum), true);
employeesGrid.EditControl.LayoutColumns = 2;
employeesGrid.EditControl.Column("notes").ControlType(EditControlType.TextArea).Hidden().DataType(typeof(string));
employeesGrid.EditControl.Column("ReportsTo").Lookup(new Lookup("employees", "employeeid", "lastname + ', ' + firstName"));
employeesGrid.EditControl.Bind(EventType.OnFormElementCreated, "configureFormElement");
@employeesGrid.Render()