Skip to main content

PivotGridControl.ShowFilterPopupExcel Event

Allows you to customize the Excel-style filter popup (for instance, to hide specific filter conditions from the Filters tab).

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v24.1.dll

NuGet Package: DevExpress.Win.PivotGrid

Declaration

[DXCategory("Behavior")]
public event FilterPopupExcelEventHandler ShowFilterPopupExcel

Event Data

The ShowFilterPopupExcel event's data class is FilterPopupExcelEventArgs. The following properties provide information specific to this event:

Property Description
DefaultFilterType Gets or sets the filter operator selected by default in the Filters tab.
Field Get the Pivot Grid field being processed.
IsRadioMode Gets or sets whether single (the radio mode) or multiple filter values can be selected simultaneously.
ShowAdvancedDatePeriods Gets or sets whether to show advanced date periods (Year to Date, All Dates in the Period).
ShowAggregates For internal use.
ShowBlanks Gets or sets whether to show the ‘Is Blank’ and ‘Is Not Blank’ filter conditions.
ShowComparisons Gets or sets whether to show comparison filter conditions (Greater Than, Less Than, etc.).
ShowCustomFilters Gets or sets whether to show the ‘Custom Filter’.
ShowDatePeriods Gets or sets whether to show date periods (Specific Date Periods, Today, Last Month, Year to Date, etc.).
ShowFiltersTab Gets or sets whether to show the Filters tab.
ShowLikeFilters Gets or sets whether to show the pattern-matching (Is Like, Is Not Like) operators for string values.
ShowNulls Gets or sets whether to show the ‘Is Null’ and ‘Is Not Null’ filter conditions.
ShowPredefinedFilters Gets or sets whether to show the ‘Predefined Filters’.
ShowSequences For internal use.

The event data class exposes the following methods:

Method Description
HideFilter(CustomUIFilterType) Hides an operator from the Filters tab.

Remarks

The ShowFilterPopupExcel event allows you to customize the Excel-style filter popup. For instance, you can use the e.IsRadioMode event parameter to disable multiselection. Other event parameters (such as e.ShowNulls and e.ShowBlanks) allow you to hide specific filter conditions from the Filters tab.

The following code sample uses the e.HideFilter method to hide operators from the Filters tab:

WinForms PivotGrid - Hide Operators from the Excel Filter

void PivotGridControl_ShowFilterPopupExcel(object sender, FilterPopupExcelEventArgs e) {
    if (e.Field == fieldModelPrice) {
        e.HideFilter(DevExpress.Utils.Filtering.Internal.CustomUIFilterType.BelowAverage);
        e.HideFilter(DevExpress.Utils.Filtering.Internal.CustomUIFilterType.Between);
        e.HideFilter(DevExpress.Utils.Filtering.Internal.CustomUIFilterType.BottomN);
        e.HideFilter(DevExpress.Utils.Filtering.Internal.CustomUIFilterType.Custom);
        e.HideFilter(DevExpress.Utils.Filtering.Internal.CustomUIFilterType.DoesNotEqual);
        e.HideFilter(DevExpress.Utils.Filtering.Internal.CustomUIFilterType.InRange);
        e.HideFilter(DevExpress.Utils.Filtering.Internal.CustomUIFilterType.LessThan);
        e.HideFilter(DevExpress.Utils.Filtering.Internal.CustomUIFilterType.LessThanOrEqualTo);
    }
}

Example

The code snippet below shows how to enable the radio mode in the Excel-style filter popup by handling the PivotGridControl.ShowFilterPopupExcel event. In this example, FilterPopupExcelEventArgs.IsRadioMode event parameter is set to true to disable multiselection for the ‘fieldTrademark’ field .

IsRadioMode = false IsRadioMode = true
WinPivot_Filtering_Excel WinPivot_Filtering_Excel_RadioMode
private void PivotGridControl_ShowFilterPopupExcel(object sender, FilterPopupExcelEventArgs e) {
    if (e.Field == fieldTrademark) {
        e.IsRadioMode = true;
    }
}
See Also