Column-Filters for Winforms PFGrid.NET
Filters can be defined easily to filter the values for cells of a column. A default-filter
of type TextFilterControl can be assigned for a column, if you like to define
a custom filter you can implement the interface IFilterControl for a user-defined
.NET control:
When a column-filter is assigned, the columns looks like this:
The appearance of the filter-icon can be overriden in the grid's renderer.
Text-Tracing for filters
By setting the property FilterType to FilterAndTrace or just
Trace, the text for
that you filtered the column will be highlighted in the corresponding cell.
The
backcolor and padding for the highlighted region can be set by the property TraceSettings
of the FilterBase-class. The same can be done for the global-filter of the TreeListView:
public FormTreeListDemo()
{
InitializeComponent();
colName.Filter = new ColumnFilter(treeListView);
SetColumnFilterBackColor(colName.Filter);
colType.Filter = new ColumnFilter(treeListView);
SetColumnFilterBackColor(colType.Filter);
colAmount.Filter = new NumberRangeColumnFilter(treeListView);
colAmount.Filter.FilterMode = EnFiltermode.Filter;
}
private void SetColumnFilterBackColor(FilterBase filter)
{
filter.TraceSettings.BackColor1 = Color.LightCyan;
filter.TraceSettings.BackColor2 = Color.LightCyan;
}