Navigation: DbNetEditCore >

Properties

 

 

 

 

BrowseControl (DbNetGridCore)

 

Instance of a DbNetGridCore control that represents the list of records in the Browse dialog.

 

Demo

 

Columns (List<string>)

 

If you only want a subset of the columns in the table to be part of the form then simply list them in the Columns property.

 

...

customersEdit.Columns = new List<string>() { "CustomerId", "CompanyName", "Address", "City", "Country", "Phone", "Fax" };

customersEdit.Labels = new List<string>() { "CustomerId", "Company Name", "Address", "City", "Country", "Mobile", "Office" };

...

 

Demo

 

Culture (string)

Allows override of the default culture which controls the default date and currency formatting and also translation where available

 

DatabaseType(enum)

DbNetEditCore can be used with a number of databases and in the case of MS SQL Server and SQLite you can normally rely on the control automatically recognising the database type from the connection string. For other database vendors we recommend specifying the database type explicitly either as a property or in the constructor.
 

...

DbNetEditCore customersEdit = new DbNetEditCore("sakila", "customers") { DatabaseType = DatabaseType.MySQL };

customersEdit.Column(new string[] { "company", "last_name", "first_name" }).Browse();

@customersEdit.Render()

...

 

Delete (boolean)
Controls the presence of the Delete button in the toolbar which allows the user to delete the currently selected record.

 

FixedFilterSql(string)
 

The FixedFilterSql property is used to assign a fixed filter to the query that restricts the rows returned to the grid from the data source. The property can be parameterized with values supplied with the FixedFilterParams property

Demo

 

FixedFilterParams(dictionary<string,object>)

 

The FixedFilterParams property is used to assign parameters values for an parameters included in the FixedFilterSql property.

 

...

productsEdit.FixedFilterSql = "discontinued = @discontinued";

productsEdit.FixedFilterParams["discontinued"] = false;

...

 

Id (string) 

 

This is the Id of the containing HTML element on the page. It can be supplied as the 3rd optional argument to the constructor if you want to render the grid inside an exisitng element. Otherwise the Id is generated and given the HTML element that the control will created at the point at which the Render method is called.

 

InitialOrderBy (string) 

 

Assigns the name of the column by which the records in the form will be ordered

 

...

productsEdit.InitialOrderBy = "unitprice desc";

...

 


Insert (boolean)
Controls the presence of the Insert button in the toolbar which allows the user to add a new record to the table

Demo

 

 

Labels (List<string>)

 

Defines the labels for the columns to be selected from the table.

 

...

customersEdit.Columns = new List<string>() { "CustomerId", "CompanyName", "Address", "City", "Country", "Phone", "Fax" };

customersEdit.Labels = new List<string>() { "CustomerId", "Company Name", "Address", "City", "Country", "Mobile", "Office" };

...

 

Demo

 

LayoutColumns (int)

 

By default all form elements are listed vertically in a single column. The LayoutColumns property allows the form elements to be distributed over a specified number of columns spreading the form across the page.
 

Demo

 

MaxImageHeight (integer)

 

Specifies the maximum height of any image rendered in grid.


Demo

 

OptimizeForLargeDataset (boolean)


If set to true then the control performance will be optimised for a large dataset (10,000+ rows)

 

 

QuickSearch (boolean)

 

Controls the presence of the "quick search" search box in the toolbar which will search across all the alphanumeric columns in the grid

 

Demo

 

Search (boolean)

 

Controls the presence of the Search button in the toolbar which opens the search dialog

 

ToolbarButtonStyle (ToolbarButtonStyle)

 

Controls the style of the toolbar buttons using the ToolbarButtonStyle enum

 

Demo

 

ToolbarPosition (ToolbarPosition)

 

Controls the position of the toolbar using the ToolbarPosition enum

 

Demo

 

ValidationMessageType(ValidationMessageType)

 

Sets the style of validation message as either Application or Native the default is Application

 

When set to Application validation messages are displayed in the message panel at the foot of the form with the related form element failing validation highlighted e.g.
 

 

 

 

When the value is set to Native the control uses the native browser error reporting method which typically has a message box floating adjacent to the form element failing validation

 

 

 

 

 

Copyright © 2023 DbNetLink