Back to Devexpress

TcxGridGetFilterImagesEvent Type

vcl-cxgridcustomtableview-21197030.md

latest3.0 KB
Original Source

TcxGridGetFilterImagesEvent Type

The procedural type for filter image retrieval events in the TcxGrid control.

Declaration

delphi
TcxGridGetFilterImagesEvent = procedure(Sender: TcxCustomGridTableItem; AValueList: TcxFilterValueList; var AImages: TCustomImageList) of object;

Parameters

NameTypeDescription
SenderTcxCustomGridTableItem

The grid table item that raised a filter image retrieval event.

| | AValueList | TcxFilterValueList |

The list of all items in the filter pop-up window. You can use this parameter to explicitly assign specific images to individual filter items as demonstrated in the code example below.

| | AImages | TCustomImageList |

Specifies the new image source for filter items. You can pass nil (in Delphi) or nullptr (in C++Builder) as the AImages parameter to hide automatically displayed filter images.

|

Remarks

The grid table item’s filter pop-up window automatically displays images for filter items if the grid item uses a TcxImageComboBox instance as an in-place editor.

You can handle filter image retrieval events to assign images to all or specific filter items. A filter item has the ImageIndex property that specifies the displayed image’s index in the source image list (AImages or the default image source).

Code Example: Reverse Filter Item Order

The following code example reverses the order of automatically displayed filter items:

delphi
procedure TMyForm.tvOrdersPaymentTypeGetFilterImages(
  Sender: TcxCustomGridTableView; AValueList: TcxFilterValueList;
  var AImages: TCustomImageList);
var
  I: Integer;
begin
  for I := 0 to AValueList.Count - 1 do
    AValueList.Items[I].ImageIndex := AValueList.Count - 1 - I;
end;
cpp
void __fastcall TMyForm::tvOrdersPaymentGetFilterImages(
  TcxCustomGridTableView *Sender, TcxFilterValueList *AValueList,
  TCustomImageList *AImages)
{
  for(int i = 0; i < AValueList.Count; i++)
    AValueList->Items[I]->ImageIndex = AValueList->Count - i;
}

Note

To display no image for a specific filter item, set its ImageIndex property to -1.

Direct TcxGridGetFilterImagesEvent Type References

The TcxCustomGridTableItem.OnGetFilterImages event references the TcxGridGetFilterImagesEvent type.

See Also

TcxGetFilterImagesEvent

cxGridCustomTableView Unit