|
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 The simplest grid can be created by specifying just the ConnectionString and FromPart properties 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. 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.
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
Adds a heading row to the grid.
Fixes the height of the edit dialog when there are a lot of editable columns. Fields will scroll inside dialog
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)
Specifies a filter to applied to the selected grid rows.
Used in combination with the FixedFilter parameter to supply parameter values.
Fixes the order in which rows are displayed in the grid. Column header sorting is nested inside the FixedOrderBy property
Groups the results by all the non-aggregated columns
Set the initial order by which rows are returned. Clicking on a column header will override this order.
Creates the ability to select multiple rows.
Another way to link grids together is to nest a grid within a parent grid using a NextedControls collection.
This property is assigned to a child control and specifies the ID of the parent DbNetGrid or DbNetEdit control
The name of the stored procedure used as a data source for the grid
The required parameters of the stored procedure used as a data source for the grid
Fixes the height of the search dialog when there are a lot of searchable columns. Fields will scroll inside dialog
The following properties control the buttons and information displayed in the 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)
Controls the appearance of the Copy To Clipboard button in the toolbar
Controls the appearance of the Delete record button in the toolbar
Controls the appearance of the grid Export button in the toolbar
Controls the appearance of the Insert new record button in the toolbar
Controls the appearance of the Navigation buttons in the toolbar
Controls the appearance of the Output Current Page Only Export option in the toolbar
Controls the appearance of the Page X of Y information in the toolbar
Controls the appearance of the Print grid button in the toolbar
Controls the appearance of the number of selected rows ( X Rows ) information in the toolbar
Controls the appearance of the Search dialog button in the toolbar
Controls the Update record button in the toolbar
|