Datagrid
The Datagrid layout control is in preview from AMT version 121 onwards.
To be able to work with Datagrids, a preview switch must be enabled.
Firstly, open the Lion.ini file found in the following directory:
..\<AMT_Environment>\Lion.
In this file, add the setting PREVIEWDATAGRID in the first uncategorized section and set its value to True.
PREVIEWDATAGRID=True |
After adding this setting, save the file and (re-)start the AMT Developer Studio.
With the preview enabled, the Datagrid should be available to use in any form.
It can be found on the Additional tab of the toolbar on the Screen Layout node.
This feature is in preview. Rapid development is taking place, it is advised to re-visit the documentation often to avoid unexpected behaviour due to changed functionality. |
Description:
The Datagrid is a graphical control that presents a tabular view of data, akin to the Listview control. Unlike the Listview control however, Datagrid columns can be added, edited or removed on runtime.
Datagrid column handlers
To facilitate editing the layout, new value type handlers are introduced to control the columns of a Datagrid.
The available Datagrid column types are:
- CalendarColumn
- CheckBoxColumn
- ComboBoxColumn
- EditBoxColumn
- ImageColumn
- LabelColumn
- MaskEditBoxColumn
The Datagrid column type handlers are declared in the local definitions section of a form in the same way as the other value type handlers in AMT.
Example:
BEGIN_DEFINITIONS
VAR
TotalAmountCol : LabelColumn
END_DEFINITIONS
The Datagrid column handler types can be assigned a column by adding new columns to the Datagrid control with the columns add<type> functions (see below for a full listing).
Example:
ROUTINE DISPLAY_MAIN
BEGIN_ROUTINE
TotalAmountCol := DATAGRID_ORDER.Columns.Addlabel (se-type.financial, 8,2, 'Col_Total', 'Total amount', 150)
END_ROUTINE
In this example a new label column with a financial value type is added to the Datagrid and assigned to the
previously defined LabelColumn handler.
For the value type, the System Enum Type is used.
Icon:
Properties:
3D
Align
AutoHeight
Color
ColumnItems
Description
Enabled
Encrypted
Font
GridLines
Height
HelpText
ImageList
ItemHeight
Left
MultiSelect
Name
Parent
ScrollBars
SortOnColumnClick
TabNumber
TabStop
Top
Visible
Width
ZOrder
Dynamic properties:
AutoHeight
Color
Enabled
FontBold
FontColor
FontItalic
FontName
FontSize
FontUnderline
GridLines
HelpText
Left
MultiSelect
SortOnColumnClick
Top
Visible
For columns the follow dynamic properties can be used:
Columns.Count
Columns[<Column index>].Caption
Columns[<Column index>].Color
Columns[<Column index>].Name
Columns[<Column
index>].Readonly
Columns[<Column index>].Width
For rows the follow dynamic properties can be used:
Rows.Count
Rows[<Row index>].Color
Rows[<Row index>].Fontbold
Rows[<Row index>].Fontcolor
Rows[<Row index>].Fontitalic
Rows[<Row index>].Fontname
Rows[<Row index>].Fontsize
Rows[<Row
index>].Fontunderline
Rows[<Row index>].Readonly
Rows[<Row index>].Selected
For the individual cells the follow dynamic properties can be used:
Rows[<Row
index>].Cells[<Column index>].Color
Rows[<Row index>].Cells[<Column index>].Fontbold
Rows[<Row index>].Cells[<Column index>].Fontcolor
Rows[<Row index>].Cells[<Column index>].Fontitalic
Rows[<Row index>].Cells[<Column index>].Fontname
Rows[<Row index>].Cells[<Column index>].Fontsize
Rows[<Row index>].Cells[<Column index>].Fontunderline
Rows[<Row index>].Cells[<Column index>].Readonly
Events:
OnEnter
OnExit
OnColumnClick
OnDblClick
OnSelectItem
Functions:
Columns.AddCalendar()
Columns.AddCheckBox()
Columns.AddComboBox()
Columns.AddEditBox()
Columns.AddImage()
Columns.AddLabel()
Columns.AddMaskEditBox()
Columns.Clear()
Rows.Add()
Rows.Clear()
Rows.Delete()
Rows.Insert()
SetFocus()
Calendar Column
AddCalendar()
Syntax to add a Calendar Column to a Datagrid:
<CalendarColumnVariable> := <Datagrid>.Columns.AddCalendar ( <Name>, <Caption>, <Width>)
Parameter | Description | Allowed Value |
Name | Name of the column. | <String> |
Caption | Text displayed at the top of the column. | <String> |
Width | Horizontal size of the column. | <Integer> |
Example:
VAR
DateCol : CalendarColumn
END_DEFINITIONS
ROUTINE DISPLAY_MAIN
BEGIN_ROUTINE
DateCol := Datagrid_Doc.Columns.AddCalendar ('DateCol', 'Date', 120)
Datagrid_Doc.Rows.Add ()
Datagrid_Doc.Rows[1].Cells[1] := today.CCYYMMDD
END_ROUTINE
For variables of the CalendarColumn type the following dynamic properties can be used:
Property | Description | Access | Allowed Value |
Caption | Text displayed at the top of the column. | Read/Write | <String> |
Color | Background color to give to the column. The default value -1 indicates that the color is inherited from the parent control. |
Read/Write | <Numeric BGR value> |
ColumnType | The (layout) Column type of this Datagrid column. This property is set at the creation of the column to Calendar. |
Read only | SE-ColumnType. Calendar |
Enabled | Boolean value that indicates if the column items are enabled. If set to False, the items will be greyed
out and disabled at runtime. |
Read/Write | <Boolean> |
FontBold | Determines whether or not the text in the column must be displayed in bold. | Read/Write | <Boolean> |
FontColor | The fontcolor for the control. | Read/Write | <Numeric BGR value> |
FontItalic | Determines whether or not the text (caption) must be displayed in italics. |
Read/Write | <Boolean> |
FontName | Name of the font that must be used for the text (caption) that is displayed in the control. |
Read/Write |
<String> |
FontSize | Size of the text (caption) that is displayed in the control. |
Read/Write |
<Integer> |
FontStrikethrough | Determines whether or not the text (caption) must be displayed with a strikethrough. |
Read/Write | <Boolean> |
FontUnderline | Determines whether or not the text (caption) must be displayed underlined. |
Read/Write | <Boolean> |
Name | Name of the column. This property can only be set at the creation of the column. |
Read only | <String> |
Type | The data type of the column. This property is set at the creation of the calendar column to String. |
Read only | SE-Type. String |
Width | Horizontal size of the column. |
Read/Write |
<Integer> |
CheckBox Column
AddCheckbox()
Syntax to add a CheckBox Column to a Datagrid:
<CheckBoxColumnVariable> := <Datagrid>.Columns.AddCheckbox ( <Type>, <Length>, <Decimals>, <Name>, <Caption>, <Width>)
Parameter | Description | Allowed Value |
Type | The data type of the column. |
SE-Type. Alpha | Boolean | Financial | Numeric | Signed | String |
Length | The number of characters that the column values can hold. |
<Integer> |
Decimals | Number of decimal characters of the column values. |
<Integer> |
Name | Name of the column. | <String> |
Caption | Text displayed at the top of the column. | <String> |
Width | Horizontal size of the column. | <Integer> |
Example:
VAR
CheckCol : CheckboxColumn
END_DEFINITIONS
ROUTINE DISPLAY_MAIN
BEGIN_ROUTINE
CheckCol := Datagrid_Doc.Columns.AddCheckbox (SE-Type.Alpha, 1, 0, 'CheckCol', '', 20)
CheckCol.Checked := 'T'
CheckCol.UnChecked := 'F'
Datagrid_Doc.Rows.Add ()
END_ROUTINE
For variables of the CheckBoxColumn type the following dynamic properties can be used:
Property | Description | Access | Allowed Value |
Caption | Text displayed at the top of the column. | Read/Write | <String> |
Checked | Value that is sent if the checkbox is checked. | Read/Write | <String> |
Color | Background color to give to the column. The value -1 indicates that the color is inherited from the parent control. |
Read/Write | <Numeric BGR value> |
ColumnType | The (layout) Column type of this Datagrid column. This property is set at the creation of the column to CheckBox. |
Read only | SE-ColumnType. CheckBox |
Decimals | Number of decimal characters of the column values. This property can only be set at the creation of the column. |
Read only | <Integer> |
Enabled | Boolean value that indicates if the column items are enabled. If set to False, the items will be greyed out and disabled at runtime. | Read/Write | <Boolean> |
Length | The number of characters that the column values can hold. This property can only be set at the creation of the column. |
Read only | <Integer> |
Name | Name of the column. This property can only be set at the creation of the column. |
Read only | <String> |
Type | The data type of the column. This property can only be set at the creation of the column. |
Read only | SE-Type. Alpha | Boolean | Financial | Numeric | Signed | String |
Unchecked | Value that is sent if the checkbox is not checked. | Read/Write | <String> |
Uppercase | If set to True, the value will be converted to UPPERCASE. |
Read/Write | <Boolean> |
Width | Horizontal size of the column. |
Read/Write |
<Integer> |
ComboBox Column
AddCombobox()
Syntax to add a ComboBox Column to a Datagrid:
<ComboBoxColumnVariable> := <Datagrid>.Columns.AddCombobox ( <Type>, <Length>, <Decimals>, <Name>, <Caption>, <Width>)
Parameter | Description | Allowed Value |
Type | The data type of the column. |
SE-Type. Alpha | Boolean | Financial | Numeric | Signed | String |
Length | The number of characters that the column values can
hold. |
<Integer> |
Decimals | Number of decimal characters of the column values. |
<Integer> |
Name | Name of the column. | <String> |
Caption | Text displayed at the top of the column. | <String> |
Width | Horizontal size of the column. | <Integer> |
Example:
VAR
ComboCol : ComboboxColumn
END_DEFINITIONS
ROUTINE DISPLAY_MAIN
BEGIN_ROUTINE
ComboCol := Datagrid_Doc.Columns.AddCombobox (SE-Type.Numeric, 1, 0, 'ComboCol', 'CustType', 60)
ComboCol.Items.Add (1, 'Company')
ComboCol.Items.Add (2, 'Private')
ComboCol.Style := SE-ComboBoxStyle.DropDownList
ComboCol.DefaultIndex := 2
Datagrid_Doc.Rows.Add ()
END_ROUTINE
For variables of the ComboBoxColumn type the following functions can be used:
Function | Description | |
Items.Add |
Adds an item to the ComboBox. |
|
<Value> |
Value the ComboBox will hold when an end user chooses this item. The value should be of the same type as the type of the ComboBoxColumn. |
|
<Display text> | The text to be displayed in the ComboBox for this item. | |
Items.Clear |
Deletes all items from the ComboBox. |
|
Items.Count |
Returns the number of items in the ComboBox. |
|
Items.Delete |
Deletes the item that corresponds to the specified index number. |
|
<Item index number> |
Index value (integer) that indicates the row of the item which must be deleted. | |
Items.Insert |
Inserts an item to the ComboBox at the specified index row. |
|
<Item index number> | Index value (integer) that indicates the row where the item must be inserted. |
|
<Value> | Value the ComboBox will hold when an end user chooses this item. The value should be of the same type as the type of the ComboBoxColumn. |
|
<Display text> | The text to be displayed in the ComboBox for this item. |
For variables of the ComboBoxColumn type the following dynamic properties can be used:
Property | Description | Access | Allowed Value |
Caption | Text displayed at the top of the column. | Read/Write | <String> |
Color | Background color to give to the column. The value -1 indicates that the color is inherited from the parent control. |
Read/Write | <Numeric BGR value> |
ColumnType | The (layout) Column type of this Datagrid column. This property is set at the creation of the column to ComboBox. |
Read only | SE-ColumnType. ComboBox |
Decimals | Number of decimal characters of the column values. This property can only be set at the creation of the column. |
Read only | <Integer> |
DefaultIndex | The index of the item that is selected as default. |
Read/Write | <Integer> |
DropDownCount | Sets the number of lines shown when the combobox is opened. |
Read/Write | <Integer> |
DropDownListSize | If set to Combobox, the drop down list has the same width as the combobox itself. This is the default
behaviour. If set to Auto, the drop down list will be the same width as the largest item in the list. |
Read/Write | SE-DropDownListSize. Auto | ComboBox |
Enabled | Boolean value that indicates if the ComboBox is enabled. If set to False, the ComboBox will be greyed
out and disabled at runtime. |
Read/Write | <Boolean> |
FontBold | Determines whether or not the text in the column must be displayed in bold. | Read/Write | <Boolean> |
FontColor | The fontcolor for the control. | Read/Write | <Numeric BGR value> |
FontItalic | Determines whether or not the text (caption) must be displayed in italics. |
Read/Write | <Boolean> |
FontName | Name of the font that must be used for the text (caption) that is displayed in the control. |
Read/Write |
<String> |
FontSize | Size of the text (caption) that is displayed in the control. |
Read/Write |
<Integer> |
FontStrikethrough | Determines whether or not the text (caption) must be displayed with a strikethrough. |
Read/Write | <Boolean> |
FontUnderline | Determines whether or not the text (caption) must be displayed underlined. |
Read/Write | <Boolean> |
IS3D | If set to true, the ComboBox is displayed in 3D. | Read/Write | <Boolean> |
Length | The number of characters that the column values can hold. This property can only be set at the creation of the column. |
Read only | <Integer> |
Name | Name of the column. This property can only be set at the creation of the column. |
Read only | <String> |
NumericCanBeEmpty | When set to True the value of the Numeric may also be all spaces, otherwise only digits are allowed.
Note: when set to True the initial value of the numeric will be empty, otherwise zero. Note 2: it can be tested whether the value is empty with the statements edit_numeric = '' or with the function NumericEmpty(edit_numeric) |
Read/Write | <Boolean> |
ReadOnly | If set to True, end users are not able to change the value of the ComboBox. If set to False, users have
both read and write permission. |
Read/Write | <Boolean> |
ScrollHorz | If set to True, a horizontal scrollbar is added to the control if not all items can be fully displayed
at once. For scrolling, end users can either use this scrollbar or the arrow keys. If set to False, and the length of the items inside a box items exceeds the length of the box item, the last characters of these items will not be shown. |
Read/Write | <Boolean> |
SearchMatch | If set to True on a Simple style ComboBox, the nearest matching item will be selected when a value is
entered. The selected item will then be used for the return value. |
Read/Write | <Boolean> |
Selected | Determines if an item should be selected in a ComboBox when the object is not set to a value and has no
default value. Options:
|
Read/Write | SE-ComboBoxSelected. First | None |
Sorted | Displays the ComboBox content in alphabetic order. If this property is set to True, end users may also
type multiple characters quickly in the layout control. The first item in the layout control for with
the first characters match with those that were typed by the end user will be selected. The default value for this property is False. |
Read/Write | <Boolean> |
Style | Display style for the column. Through a simple combo box, end users can send a manually typed value or a value that corresponds with a selected item. Through a dropdown list, end users send values for the "prefilled" items. So, in combo boxes with this style, it is not possible to type in values manually. Through a dropdown combo box, end users can send a manually typed value or a value that corresponds with a selected item. If a dropdown action follows after typing a value, AMT will first look if the typed text corresponds with a value and then (if the value doesn't exist) it will look if it exists as an item name. If the typed value was not found (neither as value nor as item), then there will be no selection. Example: Suppose that a combobox with the Style "dropdown" contains a record with an item called "ABC" and the value "1". If an enduser types "1" in this combobox and then expands it, the item "ABC" will be selected. If the end user now presses "Enter", the value "1" will be sent. |
Read/Write | SE-ComboBoxStyle. DropDown | DropDownList | Simple |
Type | The data type of the column. This property can only be set at the creation of the column. |
Read only | SE-Type. Alpha | Boolean | Financial | Numeric | Signed | String |
Uppercase | If set to True, the value will be converted to UPPERCASE. |
Read/Write | <Boolean> |
Width | Horizontal size of the column. |
Read/Write |
<Integer> |
EditBox Column
AddEditbox()
Syntax to add an EditBox Column to a Datagrid:
<EditBoxColumnVariable> := <Datagrid>.Columns.AddEditbox ( <Type>, <Length>, <Decimals>, <Name>, <Caption>, <Width>[, <Password>])
Parameter | Description | Allowed Value |
Type | The data type of the column. |
SE-Type. Alpha | Boolean | Financial | Numeric | Signed | String |
Length | The number of characters that the column values can
hold. |
<Integer> |
Decimals | Number of decimal characters of the column values. |
<Integer> |
Name | Name of the column. | <String> |
Caption | Text displayed at the top of the column. | <String> |
Width | Horizontal size of the column. | <Integer> |
Password | Optional parameter. If set to true, the user input will be displayed as asterisks (*) within the control. | <Boolean> |
Example:
VAR
NameCol : EditboxColumn
END_DEFINITIONS
ROUTINE DISPLAY_MAIN
BEGIN_ROUTINE
NameCol := Datagrid_Doc.Columns.AddEditbox (SE-Type.Alpha, 50, 0, 'NameCol', 'Name', 200)
NameCol.Alignment := SE-TextAlignment.LeftJustify
NameCol.Color := 15790320
Datagrid_Doc.Rows.Add ()
END_ROUTINE
For variables of the EditBoxColumn type the following dynamic properties can be used:
Property | Description | Access | Allowed Value |
Alignment | The alignment of text can be changed in the code definition. For the value of the alignment property, the system enumeration "SE-TextAlignment" should be used. Example: <EditboxColumnVariable>.Alignment := SE-TextAlignment.CenterJustify |
Read/Write | SE-TextAlignment. CenterJustify | LeftJustify | RightJustify |
BorderStyle | Borderstyle for the EditBox. |
Read/Write | SE-BorderStyle. None | Single | Underline |
Caption | Text displayed at the top of the column. | Read/Write | <String> |
Color | Background color to give to the column. The value -1 indicates that the color is inherited from the parent control. |
Read/Write | <Numeric BGR value> |
ColumnType | The (layout) Column type of this Datagrid column. This property is set at the creation of the column to EditBox. |
Read only | SE-ColumnType. EditBox |
DecimalChar | Character that is used as separator in decimal values.. | Read/Write | SE-DecimalChar. Comma | Default | Period |
Decimals | Number of decimal characters of the column values. This property can only be set at the creation of the column. |
Read only | <Integer> |
Enabled | Boolean value that indicates if the column items are enabled. If set to False, the items will be greyed
out and disabled at runtime. |
Read/Write | <Boolean> |
FontBold | Determines whether or not the text in the column must be displayed in bold. | Read/Write | <Boolean> |
FontColor | The fontcolor for the control. | Read/Write | <Numeric BGR value> |
FontItalic | Determines whether or not the text (caption) must be displayed in italics. |
Read/Write | <Boolean> |
FontName | Name of the font that must be used for the text (caption) that is displayed in the control. |
Read/Write |
<String> |
FontSize | Size of the text (caption) that is displayed in the control. |
Read/Write |
<Integer> |
FontStrikethrough | Determines whether or not the text (caption) must be displayed with a strikethrough. |
Read/Write | <Boolean> |
FontUnderline | Determines whether or not the text (caption) must be displayed underlined. |
Read/Write | <Boolean> |
ForceDecimalKey | If set to True, then values that are specified in the layout control will be rejected if they don't
contain the decimal character. Entering 0 (zero) is still allowed even when ForceDecimalKey is set to True. If set to False, the decimals may be omitted. If set to none, values that contain a decimal character will be rejected. The last digits entered will be used as decimals. E.g. on an numeric field with two decimals and ForceDecimalKey set to none, entering 299 will be interpreted as 2.99 If set to default, this option will work according to the global application setting. |
Read/Write | SE-ForceDecimalKey. Default | False | None | True |
IS3D | If set to true, the Editbox is displayed in 3D. | Read/Write | <Boolean> |
Length | The number of characters that the column values can hold. This property can only be set at the creation of the column. |
Read only | <Integer> |
Name | Name of the column. This property can only be set at the creation of the column. |
Read only | <String> |
NumericCanBeEmpty | When set to True the value of the Numeric may also be all spaces, otherwise only digits are allowed.
Note: when set to True the initial value of the numeric will be empty, otherwise zero. Note 2: it can be tested whether the value is empty with the statements edit_numeric = '' or with the function NumericEmpty(edit_numeric) |
Read/Write | <Boolean> |
Password |
Shows if the password parameter was set to true when the column was added to the Datagrid. Read only. If set to true, the user input will be displayed as asterisks (*) within the control. |
Read only | <Boolean> |
Readonly | If set to True, end users are not able to change the value of the Exitbox. If set to False, users have
both read and write permission. |
Read/Write | <Boolean> |
ShowLeadingZeros | The number of leading zeros to be displayed. If set to "None", no zero will be displayed for the numeric value. If set to "One", a zero will only be shown if the value is zero. If set to "All", and the value contains less characters than the valuelength supports, the value is completed with leading zeros until the full valuelength is displayed. If set to "AllExcept0" the value will show all leading zeros, except when the value is 0. |
Read/Write | SE-ShowLeadingZeros. All | AllExcept0 | None | One |
ThousandSeparator | Separator that is displayed in numeric values between every three digits counted from the right. | Read/Write | SE-ThousandSeparator. Apostrophe | Comma| Default | None | Period |
Type | The data type of the column. This property can only be set at the creation of the column. |
Read only | SE-Type. Alpha | Boolean | Financial | Numeric | Signed | String |
Uppercase | If set to True, the value will be converted to UPPERCASE. |
Read/Write | <Boolean> |
Width | Horizontal size of the column. |
Read/Write |
<Integer> |
Image Column
AddImage()
Syntax to add an Image Column to a Datagrid:
<ImageColumnVariable> := <Datagrid>.Columns.AddImage ( <Name>, <Caption>, <Width>)
Parameter | Description | Allowed Value |
Name | Name of the column. | <String> |
Caption | Text displayed at the top of the column. | <String> |
Width | Horizontal size of the column. | <Integer> |
Example:
VAR
ImageCol : ImageColumn
END_DEFINITIONS
ROUTINE DISPLAY_MAIN
BEGIN_ROUTINE
ImageCol := Datagrid_Doc.Columns.AddImage ('ImageCol', 'Logo', 40)
Datagrid_Doc.Rows.Add ()
Datagrid_Doc.Rows[1].Cells[1] := 2
END_ROUTINE
For variables of the ImageColumn type the following dynamic properties can be used:
Property | Description | Access | Allowed Value |
Caption | Text displayed at the top of the column. | Read/Write | <String> |
Color | Background color to give to the column. The value -1 indicates that the color is inherited from the parent control. |
Read/Write | <Numeric BGR value> |
ColumnType | The (layout) Column type of this Datagrid column. This property is set at the creation of the column to Image. |
Read only | SE-ColumnType. Image |
Name | Name of the column. This property can only be set at the creation of the column. |
Read only | <String> |
Type | The data type of the column. This property is set at the creation of the image column to Numeric. |
Read only | SE-Type. Numeric |
Width | Horizontal size of the column. |
Read/Write |
<Integer> |
Label Column
AddLabel()
Syntax to add an Label Column to a Datagrid:
<LabelColumnVariable> := <Datagrid>.Columns.AddLabel ( <Type>, <Length>, <Decimals>, <Format>, <Name>, <Caption>, <Width>)
Parameter | Description | Allowed Value |
Type | The data type of the column. |
SE-Type. Alpha | Boolean | Financial | Numeric | Signed | String |
Length | The number of characters that the column values can
hold. |
<Integer> |
Decimals | Number of decimal characters of the column values. |
<Integer> |
Format | Specification of how values are to be displayed. See Format characters for a list of characters with special meaning inside format specifications. |
<String> |
Name | Name of the column. | <String> |
Caption | Text displayed at the top of the column. | <String> |
Width | Horizontal size of the column. | <Integer> |
Example:
VAR
LabelCol : LabelColumn
END_DEFINITIONS
ROUTINE DISPLAY_MAIN
BEGIN_ROUTINE
LabelCol := Datagrid_Doc.Columns.AddLabel (SE-Type.Numeric, 5, 2, '$$$9.99', 'LabelCol', 'Amount', 100)
LabelCol.DecimalChar := SE-DecimalChar.Comma
Datagrid_Doc.Rows.Add ()
END_ROUTINE
For variables of the LabelColumn type the following dynamic properties can be used:
Property | Description | Access | Allowed Value |
Alignment | The alignment of text can be changed in the code definition. For the value of the alignment property, the system enumeration "SE-TextAlignment" should be used. Example: <LabelColumnVariable>.Alignment := SE-TextAlignment.CenterJustify |
Read/Write | SE-TextAlignment. CenterJustify | LeftJustify | RightJustify |
Caption | Text displayed at the top of the column. | Read/Write | <String> |
Color | Background color to give to the column. The value -1 indicates that the color is inherited from the parent control. |
Read/Write | <Numeric BGR value> |
ColumnType | The (layout) Column type of this Datagrid column. This property is set at the creation of the column to Label. |
Read only | SE-ColumnType. Label |
DecimalChar | Character that is used as separator in decimal values. | Read/Write | SE-DecimalChar. Comma | Default | Period |
Decimals | Number of decimal characters of the column values. This property can only be set at the creation of the column. |
Read only | <Integer> |
FontBold | Determines whether or not the text in the column must be displayed in bold. | Read/Write | <Boolean> |
FontColor | The fontcolor for the control. | Read/Write | <Numeric BGR value> |
FontItalic | Determines whether or not the text (caption) must be displayed in italics. |
Read/Write | <Boolean> |
FontName | Name of the font that must be used for the text (caption) that is displayed in the control. |
Read/Write |
<String> |
FontSize | Size of the text (caption) that is displayed in the control. |
Read/Write |
<Integer> |
FontStrikethrough | Determines whether or not the text (caption) must be displayed with a strikethrough. |
Read/Write | <Boolean> |
FontUnderline | Determines whether or not the text (caption) must be displayed underlined. |
Read/Write | <Boolean> |
Format | Specification of how values are to be displayed. This property is equal to the format option for Local Definitions. See Format characters for a list of characters with special meaning inside format specifications. This property can only be set at the creation of the column. |
Read only | <String> |
Length | The number of characters that the column values can hold. This property can only be set at the creation of the column. |
Read only | <Integer> |
Name | Name of the column. This property can only be set at the creation of the column. |
Read only | <String> |
NumericCanBeEmpty | When set to True the value of the Numeric may also be all spaces, otherwise only digits are allowed.
Note: when set to True the initial value of the numeric will be empty, otherwise zero. Note 2: it can be tested whether the value is empty with the statements edit_numeric = '' or with the function NumericEmpty(edit_numeric) |
Read/Write | <Boolean> |
ShowLeadingZeros | The number of leading zeros to be displayed. If set to "None", no zero will be displayed for the numeric value. If set to "One", a zero will only be shown if the value is zero. If set to "All", and the value contains less characters than the valuelength supports, the value is completed with leading zeros until the full valuelength is displayed. If set to "AllExcept0" the value will show all leading zeros, except when the value is 0. |
Read/Write | SE-ShowLeadingZeros. All | AllExcept0 | None | One |
ThousandSeparator | Separator that is displayed in numeric values between every three digits counted from the right. | Read/Write | SE-ThousandSeparator. Apostrophe | Comma| Default | None | Period |
Type | The data type of the column. This property can only be set at the creation of the column. |
Read only | SE-Type. Alpha | Boolean | Financial | Numeric | Signed | String |
Uppercase | If set to True, the value will be converted to UPPERCASE. |
Read/Write | <Boolean> |
Width | Horizontal size of the column. |
Read/Write |
<Integer> |
MaskEditBox Column
AddMaskeditbox()
Syntax to add a Maskeditbox Column to a Datagrid:
<MaskeditboxColumnVariable> := <Datagrid>.Columns.AddMaskeditbox ( <Name>, <Caption>, <Width>)
Parameter | Description | Allowed Value |
Name | Name of the column. | <String> |
Caption | Text displayed at the top of the column. | <String> |
Width | Horizontal size of the column. | <Integer> |
Example:
VAR
MaskCol : MaskeditboxColumn
END_DEFINITIONS
ROUTINE DISPLAY_MAIN
BEGIN_ROUTINE
MaskCol := Datagrid_Doc.Columns.AddMaskeditbox ('MaskCol', 'Postcode', 80)
MaskCol.Mask := '9999 aa'
MaskCol.Placeholder := '_'
MaskCol.IncludeLiterals := false
Datagrid_Doc.Rows.Add ()
END_ROUTINE
For variables of the MaskEditBoxColumn type the following dynamic properties can be used:
Property | Description | Access | Allowed Value |
BorderStyle | Borderstyle for the MaskEditBox. |
Read/Write | SE-BorderStyle. None | Single | Underline |
Caption | Text displayed at the top of the column. | Read/Write | <String> |
ClearEmpty | If set to True, the mask in an empty Maskeditbox will only be displayed when the Maskeditbox is
selected. |
Read/Write | <Boolean> |
Color | Background color to give to the column. The value -1 indicates that the color is inherited from the parent control. |
Read/Write | <Numeric BGR value> |
ColumnType | The (layout) Column type of this Datagrid column. This property is set at the creation of the column to MaskEditBox. |
Read only | SE-ColumnType. MaskEditBox |
Enabled | Boolean value that indicates if the column items are enabled. If set to False, the items will be greyed out and disabled at runtime. | Read/Write | <Boolean> |
FontBold | Determines whether or not the text in the column must be displayed in bold. | Read/Write | <Boolean> |
FontColor | The fontcolor for the control. | Read/Write | <Numeric BGR value> |
FontItalic | Determines whether or not the text (caption) must be displayed in italics. |
Read/Write | <Boolean> |
FontName | Name of the font that must be used for the text (caption) that is displayed in the control. |
Read/Write |
<String> |
FontSize | Size of the text (caption) that is displayed in the control. |
Read/Write |
<Integer> |
FontStrikethrough | Determines whether or not the text (caption) must be displayed with a strikethrough. |
Read/Write | <Boolean> |
FontUnderline | Determines whether or not the text (caption) must be displayed underlined. |
Read/Write | <Boolean> |
IncludeLiterals | If set to True, the returned value of the MaskEditBox will include the defined separator characters in
the mask. When False only the input characters will be returned. |
Read/Write | <Boolean> |
IS3D | If set to true, the MaskEditBox is displayed in 3D. | Read/Write | <Boolean> |
Mask | The mask for a Maskeditbox to control the allowed user input. Default there are three mask characters
allowed.
During input in the Maskeditbox the input characters will be checked against the allowed values and rejected when outside the allowed values. |
Read/Write |
<String> |
Name | Name of the column. This property can only be set at the creation of the column. |
Read only | <String> |
Placeholder | A single character that will be shown in the Maskeditbox at the places of the editable characters in the
displayed mask. It is important that the placeholder character may not be used in the mask definition, please keep this in mind when choosing a placeholder character. |
Read/Write |
<Character> |
Readonly | If set to True, end users are not able to change the value of the Maskeditbox. If set to False, users have both read and write permission. | Read/Write | <Boolean> |
Type | The data type of the column. This property is set at the creation of the Maskeditbox column to String. |
Read only | SE-Type. String |
Width | Horizontal size of the column. |
Read/Write |
<Integer> |
Dynamic Column Properties
Property | Description | Access | Allowed Value |
Columns.Count | Returns the number of columns in the grid. |
Read only | <Integer> |
Columns[<ColumnIndex>].Caption | Text displayed at the top of the column. |
Read/Write | <String> |
Columns[<ColumnIndex>].Color |
Background color to give to the column. The value -1 indicates that the color is inherited from the parent control. |
Read/Write | <Numeric BGR value> |
Columns[<ColumnIndex>].Name |
Name of the column. This property can only be set at the creation of the column. |
Read only | <String> |
Columns[<ColumnIndex>].Readonly | If set to True, endusers are not allowed to change the cells values inside the column. If set to False,
users have both read and write permission. |
Read/Write | <Boolean> |
Columns[<ColumnIndex>].Width | Horizontal size of the column. |
Read/Write | <Integer> |
Example:
VAR I : Numeric 3
BEGIN_ROUTINE
loop for I := 1 to Datagrid_Doc.Columns.Count step 2
Datagrid_Doc.Columns[I].Color := 15790320
endloop
END_ROUTINE
Dynamic Row Properties
Property | Description | Access | Allowed Value |
Rows.Count | Returns the number of rows in the grid. |
Read only | <Integer> |
Rows[<RowIndex>].Color |
Background color to give to the row. The value -1 indicates that the color is inherited from the parent control. |
Read/Write | <Numeric BGR value> |
Rows[<RowIndex>].FontBold | Determines whether or not the text in the row must be displayed in bold. | Read/Write | <Boolean> |
Rows[<RowIndex>].FontColor | The fontcolor for the row. | Read/Write | <Numeric BGR value> |
Rows[<RowIndex>].FontItalic | Determines whether or not the text in the row must be displayed in italics. |
Read/Write | <Boolean> |
Rows[<RowIndex>].FontName | Name of the font that must be used for the text that is displayed in the row. |
Read/Write |
<String> |
Rows[<RowIndex>].FontSize | Size of the text (caption) that is displayed in the row. |
Read/Write |
<Integer> |
Rows[<RowIndex>].FontStrikethrough | Determines whether or not the text in the row must be displayed with a strikethrough. |
Read/Write | <Boolean> |
Rows[<RowIndex>].FontUnderline | Determines whether or not the text in the row must be displayed underlined. |
Read/Write | <Boolean> |
Rows[<RowIndex>].Readonly | If set to True, end-users are not allowed to change the cells values inside that row. If set to False,
users have both read and write permission. |
Read/Write | <Boolean> |
Rows[<RowIndex>].Selected | Returns True if the row is selected, otherwise False. |
Read/Write | <Boolean> |
Dynamic Cell Properties
Property | Description | Access | Allowed Value |
Rows[<RowIndex>].Cells[<ColumnIndex>].Color |
Background color to give to the cell. The value -1 indicates that the color is inherited from the parent control. |
Read/Write | <Numeric BGR value> |
Rows[<RowIndex>].Cells[<ColumnIndex>].FontBold | Determines whether or not the text in the cell must be displayed in bold. | Read/Write | <Boolean> |
Rows[<RowIndex>].Cells[<ColumnIndex>].FontColor | The fontcolor for the cell. | Read/Write | <Numeric BGR value> |
Rows[<RowIndex>].Cells[<ColumnIndex>].FontItalic | Determines whether or not the text in the cell must be displayed in italics. |
Read/Write | <Boolean> |
Rows[<RowIndex>].Cells[<ColumnIndex>].FontName | Name of the font that must be used for the text that is displayed in the cell. |
Read/Write |
<String> |
Rows[<RowIndex>].Cells[<ColumnIndex>].FontSize | Size of the text (caption) that is displayed in the cell. |
Read/Write |
<Integer> |
Rows[<RowIndex>].Cells[<ColumnIndex>].FontUnderline | Determines whether or not the text in the cell must be displayed underlined. |
Read/Write | <Boolean> |
Rows[<RowIndex>].Cells[<ColumnIndex>].Readonly | If set to True, endusers are not allowed to change the value of the cell. If set to False,
users have both read and write permission. |
Read/Write | <Boolean> |