vcl-cxcustomdata-dot-tcxcustomdatacontroller-686b0661.md
Specifies data controller behavior flags.
property Options: TcxDataControllerOptions read; write; default [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding];
| Type | Description |
|---|---|
| TcxDataControllerOptions |
The set of flags that correspond to individual data controller behavior options.
|
Use the Options property to enable or disable specific data controller behavior options.
The Options property value can include any number of the following flags in any combination:
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.
dcoCaseInsensitiveDisables 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.
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.
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.
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.
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.
dcoGroupsAlwaysExpandedThis flag keeps all record groups expanded.dcoImmediatePostThe data controller immediately posts a field value change to the underlying dataset.dcoInsertOnNewItemRowFocusingThe 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.
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;
TcxGridDataController *ADataController = cxGrid1TableView1->DataController;
ADataController->Options = TcxDataControllerOptions() << dcoAssignGroupingValues
<< dcoAssignMasterDetailKeys << dcoSaveExpanding << dcoFocusTopRowAfterSorting;
Alternatively, you can move focus to the first record in an OnSortingChanged event handler.
The Options property’s default value is [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding].
See Also