Icon(Index: TableFilterIconState): IGxIcon;
Icon[Index: Prognoz.Platform.Interop.Forms.TableFilterIconState]: Prognoz.Platform.Interop.Drawing.GxIcon;
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.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Forms;
Imports Prognoz.Platform.Interop.Drawing;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Filter: ITableFilter;
FilterItem: ITableFilterItem;
Icon1, Icon2: GxIcon;
Begin
// Get new icons
Icon1 := New GxIconClass();
Icon1.CreateFromFile("C:\Icons\tray1.ico");
Icon2 := New GxIconClass();
Icon2.CreateFromFile("C:\Icons\tray2.ico");
Filter := dataGridView1 As ITableFilter;
// Set icons for the first column
FilterItem := Filter.Item[0];
Filteritem.Icon[TableFilterIconState.tfisSorted] := Icon1;
Filteritem.Icon[TableFilterIconState.tfisSorted Or TableFilterIconState.tfisAscending] := Icon2;
End Sub;
See also: