Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxGridBandedTableView.OnQuickCustomizationColumnCompare Event

In This Article

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

#Declaration

Delphi
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.

Delphi
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