Data Tab Page
In this tab page, there are two modes in which you can see and modify the data: either a number of records from the opened table are shown in a grid, or one record is shown in a series of single input controls.
Grid Mode
A grid is created for the currently opened table. By default, the table opens with a maximum of 20 grid columns. This value of 20 is configurable. The value of 20 is chosen to optimize the display; typically, the first 20 columns are the most important columns. A maximum of 255 columns can be used in the grid. If the grid shows a limited number of columns, the status bar will show an icon to illustrate that the number of columns is currently limited.
You can add or remove columns from the grid by navigating to the Columns Branch for the current table in the list of tables. Here you can individually select columns or select/deselect all columns. To start, you can choose “Select columns from data display” first. This floating menu option selects the columns that are present in the grid. After selecting columns, you need to press the button “Rebuild data view” or choose the same option from the floating menu.
When the data grid builds, each column gets a size based on the defined column size in the table multiplied by the average character width in the current font. Data should display correctly, but header labels will often show part of the name with a couple of dots to indicate that not all information could be shown. You can modify column widths by placing the mouse cursor on a border in the column header. The mouse cursor changes to crosshairs, and dragging this will move the column border left or right. There is a configuration option available to automatically adjust the size of the grid columns to the size of the label in the column header.
When the "Open all related-to files" configuration option is selected, the columns of the selected table that relate to a column in a parent table will be automatically replaced by that parent-table column. Since related-to columns are indexed in parent tables, you can now browse with Next (F8) and Previous (F7) among values in these columns, as with any indexed column of the selected table. If you configured Database Explorer to create selection list objects, you will have a selection list available for the parenttable.column grid column.
When you make changes to data in any cell and the "File, Options toggle Open/Set tables read-only" is not checked, your entries will be saved to disk.
Warning: If you have opened the selected file alone (that is, without its related-to files at the same time), you can easily and accidentally violate the business rules that apply to the application of which the open data file is a part. For example, you could create an invoice record for a customer that does not "exist" in the system. On the other hand, if you open your files with their related-to files, all standard business rules recorded in the data-dictionary objects for the files are used, and entries that violate data integrity are rejected. The Database Explorer will not read your .DD files and does not respect its own Data Dictionary settings.
If the opened table is a system file (a one-record table), Database Explorer will do everything it can to avoid you creating a second or more records in this table. If you opened a system file and more than one record is present, you can use the function “Reset to system table” to delete all the records except the first record.
If the cursor is in a cell that is a date column, you can insert the current date via a right mouse click, selecting “Insert system date”.
Anywhere in the data grid, you can jump to a different grid column by pressing the Ctrl+G key combination. A popup appears with all the columns of the data grid, and by selecting the desired column, you will navigate to that grid column.
A grid is not a perfect control to view and edit columns of the type DF_TEXT. Database Explorer has a configuration option so that these columns can be skipped when the grid builds. When DF_TEXT columns are present in the grid and the size of the column exceeds (defined, not actual) 255 bytes, the column is display-only and the first 255 characters are shown. Use the single record view mode to edit these columns.
Pressing Alt+C in the data grid results in a question of whether you want to count the records in the table based on the current filters or not. Note that the counting process can take some time to complete and that you cannot interrupt that process.
Changing the index in the list of tables or on the index tab page results in a different order of the data in this data grid.
The value for numeric data can be displayed in a different color when the value is less than zero. For example, when using the red color, those values get more attention. The color will be used when the value gets painted, not when you change the number. By default, this feature is turned off, so you need to turn it on and decide what color to use.
Single Record View Mode
In this mode, an input control (dbForm or cdbTextEdit/cdbRichEdit) is created for each of the columns in your table definition or fewer when you selected fewer columns for the data display.
If there are more columns and thus controls than the current height of this single record view can contain, a vertical scrollbar appears. You can use the thumb on the scrollbar to quickly browse through all the data.
When the single record view builds, the width of the individual input forms is automatically calculated from the defined column size and the average character width. The width of a text object is set to the width of the scrollable area. If you later reduce the width of the main window, a horizontal scrollbar appears, and the thumb can be used to scroll horizontally. You can enlarge the width of the controls by pressing the Ctrl+> keys. If you press Ctrl+<, the width will be reduced. These changes can be recorded. There is also a configuration option to resize the input controls to the actual data width. This is particularly useful when the data is all uppercase since uppercased characters take more width than their lowercased counterparts. The average character width cannot handle this completely for you.
The number of columns in the record layout can be made part of the label in front of the input controls. This can be useful when you deal a lot with the numbers. The default for this is OFF.
Navigation between the individual controls can be done with:
- Mouse
- Tab and Shift + Tab
- Arrow down or up
The Page Up and Page Down keys scroll the scrollable area up and down without moving the focus.
Use Saved Column or DEO Settings?
Database Explorer can be configured to store the last used columns of the data grid and/or the last used data entry controls in the Single Record View mode. From the used columns, the following information is stored: number, type, width, label, table number, is parent column. If the configuration option is selected and you click on a table in the tree view, Database Explorer checks whether there is information stored. If that is the case, depending on another configuration flag, you are queried if you want to use that information. When you get the question and decide not to use it, the base rules on opening a table are used, just if there is nothing stored. If you do not get the question, you simply see the columns – or the DEOs – for the stored column information. If any of the stored columns do not match with the current layout, that column information will not be used. This avoids the situation where, if you deleted a column, Database Explorer creates a control for this column and errors are given on usage. The same applies when the type of the column does not match anymore.