The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



ColumnFormat


Unit:SDL_replist
Class: TReportListView
Declaration: property ColumnFormat[ColNr: longint]: TColFmtString;

The array property ColumnFormat controls the editing elements of the row editor. It determines the format of the corresponding input element, its width, and the default value used when invoking the row editor.

The general syntax for the format specifier is as follows: it consists of three parts, the first and the second one being enclosed by square brackets. The first part contains the format, the second part defines the width (in pixels) of the editing element in the row editor, and the third part contains default values which are filled in automatically if the corresponding cell is empty. If the format specifier starts with a # (hash) character, the particular column is considered to be read-only. In this case the cell value is displayed using the appropriate editing element, but the editing element is disabled indicating that the cell value is read-only.

[format][visible width in pixel]default value(s)

You may omit the default values and the visible width. If the visible width is omitted the width of the editing element is set to 200 pixels. If no column format at all is defined the cell of this column will be treated as simple string with no preset default value.

The following format specifiers are defined. Please note that there are special default values which trigger the generation of special predefined values, such as row numbers or passwords.
Format Specifier Description Special Default Values
s string with max. 255 characters "$pwd$N": password with N characters. The password is generated using the procedure InventPassword. Note: in order to generate random passwords you have to call Randomize in the FormCreate event of the form.
i decimal integer "rixN": index number of the row to be edited. The row number is displayed as a decimal number with N digits (including leading zeros).
h hexadecimal integer "rixN": index number of the row to be edited. The row number is displayed as a hexadecimal number with N digits (including leading zeros).
dDATEFORMAT date/time; format is determined by the formatting strings as defined for the function ScanDateTime. If the default value is omitted, the current date/time is inserted.
f floating point number "rixN": index number of the row to be edited. The row number is displayed as a floating point number with decimal places.
e any double precision number format, including exponential notation "rixN": index number of the row to be edited. The row number is displayed as a floating point number with decimal places.
l or l:nn selection box with options The options have to be supplied as default values separated by the pipe (|) symbol. The length of the dropdown list may be controlled by an optional parameter nn separated by a colon.
c or c:nn text input with options to select from The options have to be supplied as default values separated by the pipe (|) symbol. The length of the dropdown list may be controlled by an optional parameter nn separated by a colon.

 

Examples:

Format Specifier Explanation
[i][100] decimal integer expected; width of input element is 100 pixels; no default value
[i][220]99 decimal integer expected; width of input element is 220 pixels; default value is 99
[#h]rix4 hexadecimal integer; cell is disabled (read-only); width of input element is 200 pixels since no width is specified; the default value is calculated from the row index of the row to be edited, using a decimal number with 4 digits (including leading zeros).
[s]$pwd$8 string expected; width of input element is 200 pixels since no width is specified; the default value is a computer generated password with 8 characters.
[c][230]opt1|opt2|opt3 text input expected; width of editing element is 230 pixels; the element offers three predefined options to select from (as an alternative to entering arbitrary text): "opt1", "opt2", and "opt3".
[dyyyy-MM-dd][130]2004-09-30 date expected; the date is displayed using the format "yyyy-MM-dd"; the width of the editing element is 130 pixels; the default value is Sep-30 of the year 2004.

Example: This property is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): replistv



Last Update: 2023-Dec-13