Overview

GridX provides a three-tier filtering architecture that scales from simple real-time text filtering up to complex multi-condition logic:

TierComponentComplexityUse Case
1. Quick FilterBeepQuickFilterBarLowReal-time text filtering, one input per visible column
2. Per-ColumnBeepGridFilterPopup / FilterFlyoutMediumCheckbox list of distinct values, Search/Select All/Clear All
3. AdvancedBeepAdvancedFilterDialogHighAND/OR logic, multi-column conditions, save/load filter configs

Filtering is integrated with GridSortFilterHelper and supports operators: Contains, Equals, NotEquals, StartsWith, EndsWith, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, IsNull, IsNotNull, Between.

BeepAdvancedFilterDialog

BeepAdvancedFilterDialog inherits from BeepiFormPro and presents a 900x500 resizable dialog for building complex filter conditions. It uses an embedded BeepGridPro where each row defines one filter condition (Column, Operator, Value, optional Value2 for Between).

MemberTypeDescription
ResultDialogResultReturns OK if user clicked Apply/OK, Cancel otherwise
LogicOperatorLogicOperatorAND or OR — determines how multiple conditions are combined
FilterRowsBindingList<FilterRowData>Data-bound list of filter conditions

The dialog layout:

  • Logic combo: Dropdown at the top selecting AND (all conditions must match) or OR (any condition matches)
  • Filter grid: BeepGridPro with columns: Column (ComboBox of grid columns), Operator (ComboBox of operators), Value (TextBox), Value2 (TextBox, visible only for Between operator)
  • Action buttons: Add Condition, Remove Condition, Clear All, Save Config, Load Config, OK, Cancel

Constructor signature: BeepAdvancedFilterDialog(BeepGridPro parentGrid, List<FilterRowData> existingRows = null, LogicOperator existingLogic = LogicOperator.AND)

FilterRowData Model

FilterRowData implements INotifyPropertyChanged and represents a single filter condition.

PropertyTypeDefaultDescription
ColumnNamestring""Target column for this filter condition
OperatorFilterOperatorContainsComparison operator
Valuestring""Primary filter value
Value2string""Secondary value for Between operator (range end)

The FilterOperator enum includes: Contains, Equals, NotEquals, StartsWith, EndsWith, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, IsNull, IsNotNull, Between.

BeepQuickFilterBar

BeepQuickFilterBar renders a toolbar row above the grid column headers with one text input per visible column. Typing in any input instantly filters the grid's data source.

PropertyTypeDefaultDescription
ShowTopFilterPanelboolfalseEnables the quick filter bar
TopFilterPanelHeightint28Pixel height of the filter bar row

Filtering uses Contains operator (case-insensitive) by default. The filter is applied in real time as the user types — no Enter key or button press needed. The filter bar respects column visibility: only visible columns get filter inputs.

Per-Column Popups

BeepGridFilterPopup (also referred to as FilterFlyout) provides an Excel-style dropdown of distinct values for a single column. It appears when the user clicks a filter icon in the column header.

Key UI elements:

  • Search box — filters the distinct value list itself
  • Checkbox list — each distinct value with a checkbox; checked = included in results
  • Select All / Clear All — bulk toggle buttons
  • OK / Cancel — apply or discard filter

The popup is populated by calling GetDistinctValues(columnName) on the data source. For large datasets, a configurable limit (default 1000) prevents excessive popup rendering. The popup auto-sizes based on content and positions relative to the column header.

Filter Dialogs & Helpers

ClassDescription
GridDialogHelper.FilteringDialogsStatic helper that launches filtering-related dialogs from toolbar/menu actions
BeepInlineCriterionMenuInline filter row rendered inside the grid between header and data rows; adds a filter criterion row with dropdowns
ExcelFilterHelperProvides Excel-style distinct-value filtering: GetDistinctValues(), HasActiveFilter(), ClearFilter(), ApplyChecklistFilter()

ExcelFilterHelper works directly with the grid's DataView or IBindingListView to apply row filters. It translates checkbox selections into a DataView.RowFilter string expression.

Examples

Enable Quick Filter Bar

grid.ShowTopFilterPanel = true;
grid.TopFilterPanelHeight = 32;

Open Advanced Filter Dialog

var dialog = new BeepAdvancedFilterDialog(grid)
{
    PreferredContentWidth = 900,
    PreferredContentHeight = 500
};

if (dialog.ShowDialog() == DialogResult.OK)
{
    GridDialogHelper.FilteringDialogs.ApplyAdvancedFilter(
        grid,
        dialog.FilterRows.ToList(),
        dialog.LogicOperator);
}

Save & Load Filter Configs

var filterRows = new List<FilterRowData>
{
    new FilterRowData { ColumnName = "Status", Operator = FilterOperator.Equals, Value = "Active" },
    new FilterRowData { ColumnName = "Amount", Operator = FilterOperator.GreaterThan, Value = "1000" }
};

string json = JsonConvert.SerializeObject(filterRows);
File.WriteAllText(@"C:\configs\myfilter.json", json);

var loaded = JsonConvert.DeserializeObject<List<FilterRowData>>(
    File.ReadAllText(@"C:\configs\myfilter.json"));

GridDialogHelper.FilteringDialogs.ApplyAdvancedFilter(
    grid, loaded, LogicOperator.AND);

Programmatic Distinct-Value Filter

var helper = new ExcelFilterHelper(grid);

var distinctValues = helper.GetDistinctValues("Country");

var selectedValues = new List<string> { "USA", "Canada", "UK" };
helper.ApplyChecklistFilter("Country", selectedValues);

bool hasFilter = helper.HasActiveFilter("Country");

helper.ClearFilter("Country");