# Grid Control

Formatting a Grid |

## Grid Format Definition

Once the grid control is placed on a panel, you can set properties to change the grid's appearance and functionality.

The Grid Format Definition dialogue is used to format the grid and specify grid cell attributes. It is invoked by clicking the Format button located on the Attributes and Presets panels of the Grid Properties dialogue.

This dialogue consists of the following:

Title | Title to appear above each column. Click the dotted button to invoke a separate dialogue to input a fixed value or expression or to reference a user-defined message.
Width | Click the dotted button to invoke a separate dialogue for entering the starting width of the column, either a fixed value or an expression.
Alignment | Select a text alignment from the drop-down list: Left, Right, Center. This alignment is applied to all the rows as they are added to the grid by default.
Cell Type | Click the drop-down arrow for a list of available cell types for the column. The various cell types are listed below. Default cell type is Normal.
Cell Type | Description
Button | Cell works like a button if clicked. Cell can be changed if not locked (on double click). Set the 'Lock property to 1 to achieve standard button behavior for cell.
CheckBox | Check box with no 3D effect.
CheckBoxRaised | 3D check box that looks raised.
CheckBoxRecessed | 3D check box that looks recessed.
CheckMark | Check box that uses a check mark.
CheckMarkRaised | Raised check box that uses a check mark.
CheckMarkRecessed | Recessed check box that uses a check mark.
DropBox | A text cell that, when editing, allows the user to make a selection from a drop-down list. The drop list is loaded from the 'Text$ property. Drop boxes provide a multiple character search capability that makes it easier to search for an exact match in a drop box list. See Multiple Character Search. (Multiple character search in drop boxes was added in PxPlus 2019.)
DropBoxHideBtn | Same as DropBox, but the drop-down button is shown only when focus is on the cell. Drop boxes provide a multiple character search capability that makes it easier to search for an exact match in a drop box list. See Multiple Character Search. (Multiple character search in drop boxes was added in PxPlus 2019.)
Ellipsis | Normal text cell that will show three dots (…) if text exceeds displayable area. Ctrl - Enter can be used to force a new line in the cell (inserts $0D0A$ into cell value).
EllipsisDrop | Same as Ellipsis, but forces the cell to drop vertically only during an edit. Ctrl - Enter can be used to force a new line in the cell (inserts $0D0A$ into cell value).
FlatButton | A flat button that shows no visible change when clicked. (Added in PxPlus 2014 Feature Pack 1 - Update 0001)
FlatButtonInOnly | A button that looks flat only when not depressed. (Added in PxPlus 2014 Feature Pack 1 - Update 0001)
FlatTextButton | Similar to TextButton, but the button is flat and shows no visible change when clicked. (Added in PxPlus 2014 Feature Pack 1 - Update 0001)
FlatTextButtonInOnly | Similar to TextButton, but the button looks flat only when not depressed. (Added in PxPlus 2014 Feature Pack 1 - Update 0001)
Lookup | Small button at the right side of the cell used to invoke a lookup. Button image is defined via the cell's 'Bitmap$ property. If no image is given, button shows three dots (…).
LookupHideBtn | Same as Lookup, but indicates that the button is hidden when the cell is not selected.
Multi_line | Normal text cell that can contain multiple lines of text. Press Enter or Ctrl - Enter to create a new line (value $0D0A$). When the cell being edited contains multiple lines of text, the Up/Down arrow keys can be used to move within the lines of text. Pressing Enter twice consecutively exits the cell being edited. (Added the use of Enter and Up/Down arrow keys when editing a cell in PxPlus 2017 Update 0004)
Normal | Normal text cell that contains one line of data.
Query | Same as Lookup, but the user is unable to edit the cell.
QueryHideBtn | Same as LookupHideBtn, but the user is unable to edit the cell.
SingleLine | Normal text cell that allows for a single line of entry, expanding the cell horizontally according to the overlap rules. It does not allow vertical expansion like a multi-line.
TextButton | Similar to Button, except that the text on the button adheres to the 'Align$ property and will wrap. (Added in PxPlus 2014 Feature Pack 1 - Update 0001)
UseTextEllipsis UseTextNormal UseTextSingleLine | Similar to Ellipsis, Normal and SingleLine respectively, except the value of 'Text$ property is displayed. During input and editing, the 'Value$ property is presented and entered into the cell. Sorting on a column is done using the 'Value$ property. To sort a date column, set the cell type to UseTextNormal, and then write a sortable value to the cell's 'Value$ property and set the 'Text$ property to the value to be displayed.
VarDropBox | A text cell that, when editing, allows the user to make a selection from a drop-down list or enter any other value. Drop list selections are loaded using the 'Text$ property. Drop boxes provide a multiple character search capability that makes it easier to search for an exact match in a drop box list. See Multiple Character Search. (Multiple character search in drop boxes was added in PxPlus 2019.)
VarDropBoxHideBtn | Same as VarDropBox, but the drop-down button is shown only when focus is on the cell. Drop boxes provide a multiple character search capability that makes it easier to search for an exact match in a drop box list. See Multiple Character Search. (Multiple character search in drop boxes was added in PxPlus 2019.)
Column Name | Logical name of the column. (See Named Columns.)
Column Separator | Click the drop-down arrow to select a Hex or ASCII string value as the default separator character to use between columns during a load.
Static Columns | Used to set the number of leftmost columns that will remain fixed and will not be resized when the display is scrolled horizontally.
Insert Above Insert Below | Adds a blank row above or below the currently selected row for creating a new column.
Delete | Removes the currently selected row (i.e. removes the column from the grid).
Move Up Move Down | Changes the order of the existing columns in the grid.

Multiple Character Search

Drop boxes provide a multiple character search capability that makes it easier to search for an exact match in a drop box list.

#### Note:
Multiple character search applies to the following drop box Cell Types: "DropBox", "DropBoxHideBtn", "VarDropBox" and "VarDropBoxHideBtn".

To use this capability effectively, the characters must be entered within a ½ second of one another and must exactly match the start of an item in the drop box.

Example:

Assume that a drop box contains the following items:

> C10000
> C30000
> C50000

Typing the character "c" followed within ½ second by the number "3" would select the "C30000" item.

#### Note:
In drop boxes, searching always starts from the current selection and wraps.

(Multiple character search in drop boxes was added in PxPlus 2019.)