ITableFilterItem.Icon

Syntax

Icon(Index: TableFilterIconState): IGxIcon;

Parameters

Index. Icon state index.

Description

The Icon property determines autofilter button icon for corresponding state.

Comments

The element of the TableFilterIconState.Ascending enumeration is determines only in combination with the element of TableFilterIconState.Sorted.

Example

Executing the example requires a form with the Button component named Button1, the DataGrid component with the DataGrid1 identifier, and the UiDataSource component with the UiDataSource1 identifier. Specify the UiDataSource1 component as a data source for the DataGrid1 component.

Add a link to the Drawing system assembly.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Filter: ITableFilter;
    FilterItem: ITableFilterItem;
    Icon1, Icon2: IGxIcon;
Begin
    // Get new icons
    Icon1 := New GxIcon.CreateFromFile("C:\Icons\tray1.ico");
    Icon2 := New GxIcon.CreateFromFile("C:\Icons\tray2.ico");
    Filter := DataGrid1.TableFilter;
    // Set icons for the first column
    FilterItem := Filter.Item(0);
    Filteritem.Icon(TableFilterIconState.Sorted) := Icon1;
    Filteritem.Icon(TableFilterIconState.Sorted Or TableFilterIconState.Ascending) := Icon2;
End Sub Button1OnClick;

On clicking the Button1 new descending and ascending sorting icons are set for the first column.

See also:

ITableFilterItem