Multiselect and Clipboard
Multiselect and Clipboard Operations
TVertDBGridEh allows you to select the line and rectangular areas for further operations on the selected area (for example, for copying to the clipboard).
To enable multiple selection, set the following properties:
EditActions
AllowedSelections
Selection
The property is of type TVertDBGridEh.Selection
TDBVertGridSelectionEh and contains the following properties and methods.
property AnchorRowIndex: Integer
property Rows: TFieldRowSelectionListEh
property SelectionType: TDBVertGridSelectionTypeEh
property ShipRowIndex: Integer
function IsCellSelected(ACol, ARow: Integer): Boolean;
procedure Clear;
procedure SelectAll;
procedure SelectAllDataCells;
Use TVertDBGridEh.Selection.SelectionType property to determine the current view selection.
Selection.SelectionType has TDBVertGridSelectionTypeEh type and can contain the following values
vgstRowsEh
<sh>Allocate a full-line recording. To access the recording, use a dedicated property Selection.Rows.</sh>
vgstRectangleEh
<sh>Select a square region of the data. For access to the borders of the area and use the properties of Selection.AnchorRowIndex Selection.ShipRowIndex.</sh>
vgstAllEh
<sh>Select the entire grid.</sh>
vgstNonEh
<sh>Multiple selection is absent.</sh>
The TVertDBGridEh.Selection.Rows property is of type TFieldRowSelectionListEh and contains the following properties and methods:
property Count: Integer
property Items[Index: Integer]: TFieldRowEh
procedure AddSelectedRow(ARow: TFieldRowEh);
procedure Clear;
procedure RemoveSelectedRow(ARow: TFieldRowEh);
procedure SelectAll;
When the user selects a rectangular area of data in the data grid on the allocation are stored in the properties and Selection.AnchorRowIndex Selection.ShipRowIndex. When a rectangular selection one cell always remains fixed and specifies anchor selection AnchorRowIndex. The second cell specifies ShipRowIndex second selection border. If the user presses and drags the mouse up or down, the value changes in ShipRowIndex property.
