DbNetGrid

Top  Previous  Next

 

The DbNetGrid control is a database aware grid control that is designed to create a browser based interface for database information stored in a table, view or stored procedure.

 

Example code

 

Below is an overview of the DbNetGrid server-side API, the complete server-side API reference can be found here

Basic Properties

The simplest grid can be created by specifying just the ConnectionString and FromPart properties

ConnectionString

The ConnectionString property provides the information necessary to connect to the database. The connection string can either be an actual connection string or an alias which is resolved by finding a matching entry in the <connectionStrings> section of the web.config file. For details of specifying connection strings see the database connectivity section.

FromPart

The FromPart property specifies the name of the table(s) or view(s) from which the grid data should be selected. Data from multiple tables can be selected by including the join statement with the tables e.g.

Run Sample

Columns

The Columns collection allows you to specify the columns that you require from the table(s) and or view(s) specified in the FromPart property

Run Sample

Additional Properties

Caption

Adds a heading row to the grid.

Run Sample

EditDialogHeight

Fixes the height of the edit dialog when there are a lot of editable columns. Fields will scroll inside dialog

Run Sample

FilterColumnMode

Controls the mode in which filter columns operate. Possible values are Simple (selected value is applied as a filter on its own) or Composite (selected value is applied in combination with other selected filter column values)

Run Sample

FixedFilter

Specifies a filter to applied to the selected grid rows.

 

FixedFilterParameters

Used in combination with the FixedFilter parameter to supply parameter values.

Run Sample

 

FixedOrderBy

Fixes the order in which rows are displayed in the grid. Column header sorting is nested inside the FixedOrderBy property

Run Sample

 

GroupBy

Groups the results by all the non-aggregated columns

Run Sample

 

InitialOrderBy

Set the initial order by which rows are returned. Clicking on a column header will override this order.

 

MultiRowSelect

Creates the ability to select multiple rows.

Run Sample

 

NestedControls

Another way to link grids together is to nest a grid within a parent grid using a NextedControls collection.

Run Sample

 

ParentControlID

This property is assigned to a child control and specifies the ID of the parent DbNetGrid or DbNetEdit control

Run Sample

 

ProcedureName

The name of the stored procedure used as a data source for the grid

 

ProcedureParameters

The required parameters of the stored procedure used as a data source for the grid

Run Sample

SearchDialogHeight

Fixes the height of the search dialog when there are a lot of searchable columns. Fields will scroll inside dialog

Run Sample

Toolbar Properties

The following properties control the buttons and information displayed in the toolbar

Run Sample

Toolbar

Sets the location/visibility of the toolbar. Values are Top (toolbar displayed above grid), Bottom (toolbar displayed below grid) or Hidden (toolbar is hidden)

Copy

Controls the appearance of the Copy To Clipboard button in the toolbar

 

Delete

Controls the appearance of the Delete record button in the toolbar

 

Export

Controls the appearance of the grid Export button in the toolbar

 

Insert

Controls the appearance of the Insert new record button in the toolbar

 

Navigation

Controls the appearance of the Navigation buttons in the toolbar

 

OutputCurrentPageOption

Controls the appearance of the Output Current Page Only Export option in the toolbar

 

PageInfo

Controls the appearance of the Page X of Y information in the toolbar

 

Print

Controls the appearance of the Print grid button in the toolbar

 

RowInfo

Controls the appearance of the number of selected rows ( X Rows ) information in the toolbar

 

Search

Controls the appearance of the Search dialog button in the toolbar

 

Update

Controls the Update record button in the toolbar