WhereColumnFilterPanel
Namespace: Wisej.Web.Ext.ColumnFilter
Assembly: Wisej.Web.Ext.ColumnFilter (4.1.0.0)
Column filter panel that lets the user build up to five conditions, each made of an operator and a value, combined with AND/OR. The available operators depend on the ValueType of the column.
- C#
- VB.NET
public class WhereColumnFilterPanel : ColumnFilterPanel
Public Class WhereColumnFilterPanel
Inherits ColumnFilterPanel
String columns (and DataGridViewComboBoxColumn columns) offer text operators such as equal to, contains, starts with and a "match case" option; the comparison uses the formatted value of the cells. DateTime columns compare only the date part using a date picker. Boolean columns offer is true / is false / is null / is not null. Int32, Int64, Decimal and Double columns offer the relational operators. Other value types are not filtered. The conditions are converted to a System.Linq.Dynamic.Core expression; the expressions of all the filtered columns are combined with AND and evaluated against the rows of the DataGridView.
Example:
Using this panel with the ColumnFilter extender:
this.dataGridView1.Columns["OrderDate"].ValueType = typeof(DateTime);
this.columnFilter1.FilterPanelType = typeof(WhereColumnFilterPanel);
this.columnFilter1.SetShowFilter(this.dataGridView1.Columns["OrderDate"], true);
Constructors
WhereColumnFilterPanel()
Initializes a new instance of the WhereColumnFilterPanel class.
Methods
ApplyFilters()
Applies the filters registered with each column in the order of creation in the Columns collection.
Clear(applyFilters)
Clears the filter panel by resetting all the operators, values and dates.
| Parameter | Type | Description |
|---|---|---|
| applyFilters | Boolean | True (default) to re-apply the filters of all the columns and close the panel. |
When no operator is selected the column is not filtered.
Example:
Removing the filter from a specific column:
var panel = this.dataGridView1.Columns["OrderDate"].UserData.FilterPanel as WhereColumnFilterPanel;
panel?.Clear();
Dispose(disposing)
Clean up any resources being used.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | true if managed resources should be disposed; otherwise, false. |
OnApplyFilter()
Invoked when the ColumnFilterPanel should apply the filter criteria selected by the user.
Returns: Boolean. True to indicate that the filter has been applied. False if the filter has been cleared.
OnBeforeShow()
Show hide controls based on the ValueType