Skip to main content

TcxCustomDataController.Options Property

Specifies data controller behavior flags.

Declaration

property Options: TcxDataControllerOptions read; write; default [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding];

Property Value

Type Description
TcxDataControllerOptions

The set of flags that correspond to individual data controller behavior options.

Remarks

Use the Options property to enable or disable specific data controller behavior options.

Data Controller Behavior Flags

The Options property value can include any number of the following flags in any combination:

dcoAnsiSort

Forces the built-in sort algorithm to use active locale settings to sort records by string values.

If this flag is not set, all string comparison operations rely on ordinal values of characters in a string.

dcoCaseInsensitive
Disables case sensitivity for sort operations.
dcoAssignGroupingValues

Default. A record insert operation automatically assigns grouping values from the focused record if grouping is in effect.

If this flag is not set, a record insert operation does not assign grouping values.

dcoAssignMasterDetailKeys

Default. A record insert operation in a detail dataset automatically assigns record fields specified through the DetailKeyFieldNames property.

The DetailKeyFieldNames property specifies key fields in a detail dataset that allows the data controller to establish a master-detail relationship with a master dataset.

Note

This flag affects only detail datasets in an established master-detail relationship with a master dataset.

dcoSaveExpanding

The data controller maintains current expansion and selection states of all row groups after a record reload operation from the underlying dataset.

If this flag is not set, a record reload operation resets expansion and selection states for all row groups.

dcoSortByDisplayText

The data controller sorts records by cell display text rather than field values. This option is useful if you assign the TcxExtLookupComboBox or TcxComboBox as an in-place editor for a grid data item.

If this flag is not set, the data controller sorts records by field values.

dcoFocusTopRowAfterSorting

The data controller moves focus to the top record after a sort operation.

If this flag is not set, sort operations do not affect focus. For example, you can change focus behavior in an OnSortingChanged event handler.

dcoGroupsAlwaysExpanded
This flag keeps all record groups expanded.
dcoImmediatePost
The data controller immediately posts a field value change to the underlying dataset.
dcoInsertOnNewItemRowFocusing
The data controller adds a new record to the underlying dataset when a newly created data row receives focus.
dcoMultiSelectionSyncGroupWithChildren

The data controller synchronizes the selected state of group rows and their grouped rows.

Note

This flag affects the row selection behavior only if the MultiSelect property is set to True. Otherwise, a user can select only one row at a time.

Code Example

The following code example moves focus to the first record after a sort operation:

var
  ADataController: TcxGridDataController;
begin
  ADataController := cxGrid1TableView1.DataController;
  ADataController.Options := ADataController.Options + [dcoFocusTopRowAfterSorting];
end;

Alternatively, you can move focus to the first record in an OnSortingChanged event handler.

Default Value

The Options property’s default value is [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding].

See Also