DB Grid |
DB Grid allows to display and to edit in tabulated form the information from all fields of the database table. The external view of a grid corresponds to an internal structure of the DB table and data set, thus a record corresponds to a grid's line, and a field corresponds to column. Properties of a component are the followings: Color, Ctl3D, Font, Height, Hint, Left, Read only, Name, Show hint, Top, Width. Options - set of nested properties defining signs (True / False) for elements displaying of the table's external view - headers, indicator of a current record, horizontal lines of strings, verticals of columns. By default all of them have True value. Columns - is used for call of the Columns editor. With help of a grid the user controls a data set, the fields of which are displayed in this grid. For moving along records and their review the scrollbars and arrow keys are used. For transition into edit mode of a current record's field it is enough to click any of alphanumeric keys, when the cursor is placed on a field. The transition into an insert mode of a new record is executed at pressing the <Insert> key. The record's insert occurs in that place, where a current record's pointer is located. It is possible to accept changes made at editing or record's addition, having hit the key <Enter> or having passed to other record, or to cancel changes, having hit the key <Esc>. For record's deleting is necessary to click keys <Ctrl> + <Delete>. The separate column of a grid represents the object. By default a separate column automatically forms for each field of a data set, linked with a DB Grid component, and all columns are accessible in a grid. Such columns are dynamic one. For creation of static columns the special Columns editor is used. If even one grid's column is the static, the dynamic columns do not form for any other field of a data set. And the static columns are accessible in a data set, and the remaining columns are considered unavailable. To define or to cancel a structure of static columns it is possible by using of the Columns editor on a development's stage of the application. To advantages of static columns it is possible to refer that for their objects there is a possibility to set the values of properties which differ from properties of the appropriate field. For example, if for some static column you set its own name, it will not vary even in the event that other field of a data set links with this column. Columns editor may be called by way of Columns property's value in an Object inspector. The list of static columns occupy majority of the editor, thus the columns are enumerated in order of their creation, this order can differ from the initial order of fields in a data set. Originally list of static columns is empty. It means, that all columns of a grid are dynamic one. With the help of Columns editor it is possible to fulfil the followings: - To create a new static column; - To delete a static column; - To change the order of static columns. Main properties of the column's object: Alignment - control alignment of values in cells of a column, possible values are: - Left justify (by default); - Center; - Right justify. Color - defines a background color of selected column. Font - defines color, font and style of displaying for characters in a selected column, is controlled both through the set of nested properties, and through the dialog box. Title - set of nested properties which define column's caption, background color of title, horizontal alignment of title, font designing of title. Width - width of the selected column at grid's displaying. Font of title - define color, font and displaying's style for all titles of grid, is controlled both through the set of nested properties, and through the dialog box. Pick list - represents the list for choice of values, entered into a field. Current cell together with the Pick list may be considered as a component "DB Lookup combobox". If Pick list is formed for a column, at editing's attempt of this column's cell on the right an arrow appear. If you press this arrow the list will be opened, where you can select one of elements. Thus it is possible to enter any acceptable value into cell.
|