ITableFilterItem.Icon

Syntax

Icon(Index: TableFilterIconState): IGxIcon;

Parameters

Index. Icon state index.

Description

The Icon property determines an icon of autofilter button for the appropriate state.

Comments

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

Example

Executing the example requires a form that contains the Button component with the Button1 identifier, 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 link to the Drawing system assembly.

The example is the OnClick event handler 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;

Clicking the Button1 button sets new icons to display ascending and descending sorting.

See also:

ITableFilterItem