Skip to main content

TcxGridBandedTableView.OnQuickCustomizationColumnCompare Event

Enables you to customize the order in which the Quick Column Customization dropdown displays its column names.

Declaration

property OnQuickCustomizationColumnCompare: TcxGridBandQuickCustomizationColumnCompareEvent read; write;

Remarks

Implement a function of the TListSortCompare procedural type and pass its entry point as the ACompareFunction parameter. The function returns an Integer value specifying the comparison result between two column names and their relative position in the dropdown. The columns are identified by check box items (TdxCustomCheckListBoxItem objects) passed as the Item1 and Item2 parameters. Refer to the TListSortCompare type description to learn about possible function return values.

The following code example shows how to handle this event to arrange columns in the ascending order of their indexes.

uses
  ..., cxListBox;
implementation
procedure <Form>.<View>QuickCustomizationColumnCompare(var ACompareFunction: TListSortCompare);
  function GetCompareFunctionResult(AItem1, AItem2: Pointer): Integer;
  begin
    Result := (TdxCustomCheckListBoxItem(AItem1).Data as TcxGridBandedColumn).Index - (TdxCustomCheckListBoxItem(AItem2).Data as TcxGridBandedColumn).Index;
  end;
begin
  ACompareFunction := @GetCompareFunctionResult;
end;

Note

The OnQuickCustomizationColumnCompare event fires only if the View’s OptionsCustomize.ColumnsQuickCustomizationSorted property is set to False.

See Also