Skip to main content

TcxGridTableController.SelectColumns(TcxGridColumn,TcxGridColumn) Method

Selects specific columns within the (Banded) Table View’s currently selected records.

Declaration

procedure SelectColumns(AFromColumn: TcxGridColumn; AToColumn: TcxGridColumn);

Parameters

Name Type
AFromColumn TcxGridColumn
AToColumn TcxGridColumn

Remarks

Call the SelectColumns method to select only specific columns (i.e. their cells) within the (Banded) Table View’s currently selected records. The column range is defined by the AFromColumn and AToColumn parameters. The AFromColumn and AToColumn parameters represent bound columns for the column range that specifies the columns whose cells will be selected. The order in which parameters are specified does not matter, e.g. the column denoted by the AToColumn can precede (using its horizontal position) the column which corresponds to the AFromColumn parameter.

Note

the SelectColumns method automatically deselects the columns that are outside the column range specified by the parameters.

If the column specified by the parameter is not visible within the View, then the first visible column is used instead of the AFromColumn parameter and the last visible column is used instead of the AToColumn parameter.

Use the SelectAllColumns method to select all columns (their cells) within the current record selection. In order to select specific cells (columns and rows) within a View, call the SelectCells method.

For instance, the following code example is the equivalent to the SelectAllColumns method’s call.

tableView.Controller.SelectColumns(nil, nil);

To enable cell (column) selection, set the View’s OptionsSelection.CellMultiSelect property to True.

Refer to the SelectedRecords and SelectedColumns properties for details on selected records and columns.

See Also