Icon(Index: TableFilterIconState): IGxIcon;
Index. Icon state index.
The Icon property determines an icon of autofilter button for the appropriate state.
The element of the TableFilterIconState.Ascending enumeration is determined only in combination with the TableFilterIconState.Sorted element.
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: