Browse

Docs

Using the Browse method to make certain fields browsable will result the addition of a Browse button to the toolbar which allows the record set to be viewed and navigated. The browse control in an instance of the DbNetGridCore control and can be configured via the BrowseControl property. The sample also demonstrates use of the Validation method to provide validation against the Title Of Courtesy field with the validation message making use of the OnFormElementValidationFailed.

Razor
                                
                                        
    DbNetEditCore employeesEdit = new DbNetEditCore("northwind", "employees");
    employeesEdit.Column("ReportsTo").Lookup(new Lookup("employees", "employeeid", "lastname + ', ' + firstname"));
    employeesEdit.Column("notes").ControlType(EditControlType.TextArea);
    employeesEdit.Column("titleofcourtesy").Validation(new InputValidation("Mr.|Dr.|Ms.|Mr."));
    employeesEdit.Column(new string[] { "lastname", "firstname", "photo", "country" }).Browse();
    employeesEdit.Column(new string[] { "lastname", "firstname", "titleofcourtesy" }).Required();
    employeesEdit.Column("Photo").Image(new ImageConfiguration("jpg"));
    employeesEdit.Column("country").Lookup(typeof(CountryEnum), true);
    employeesEdit.MaxImageHeight = 40;
    employeesEdit.Bind(EventType.OnConfigureBinaryData, "configureImageFileName");
    employeesEdit.Bind(EventType.OnFormElementValidationFailed, "configureValidationMessage");
    employeesEdit.Bind(EventType.OnFormElementCreated, "configureFormElement");
    employeesEdit.BrowseControl.MaxImageHeight = 20;
    employeesEdit.LayoutColumns = 2;
    employeesEdit.Insert = true;
    employeesEdit.Delete = true;
    @employeesEdit.Render()