Back to Devexpress

PivotGridControl.ShowFilterPopupExcel Event

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridcontrol-d6a4e538.md

latest8.1 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
[DXCategory("Behavior")]
public event FilterPopupExcelEventHandler ShowFilterPopupExcel
vb
<DXCategory("Behavior")>
Public Event ShowFilterPopupExcel As FilterPopupExcelEventHandler

Event Data

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

PropertyDescription
DefaultFilterTypeGets or sets the filter operator selected by default in the Filters tab.
FieldGet the Pivot Grid field being processed.
IsRadioModeGets or sets whether single (the radio mode) or multiple filter values can be selected simultaneously.
ShowAdvancedDatePeriodsGets or sets whether to show advanced date periods (Year to Date, All Dates in the Period).
ShowAggregatesFor internal use.
ShowBlanksGets or sets whether to show the ‘Is Blank’ and ‘Is Not Blank’ filter conditions.
ShowComparisonsGets or sets whether to show comparison filter conditions (Greater Than, Less Than, etc.).
ShowConditionalFilters
ShowCustomFiltersGets or sets whether to show the ‘Custom Filter’.
ShowDatePeriodsGets or sets whether to show date periods (Specific Date Periods, Today, Last Month, Year to Date, etc.).
ShowFiltersTabGets or sets whether to show the Filters tab.
ShowLikeFiltersGets or sets whether to show the pattern-matching (Is Like, Is Not Like) operators for string values.
ShowNullsGets or sets whether to show the ‘Is Null’ and ‘Is Not Null’ filter conditions.
ShowPredefinedFiltersGets or sets whether to show the ‘Predefined Filters’.
ShowSequencesFor internal use.
ShowTimePeriods

The event data class exposes the following methods:

MethodDescription
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:

csharp
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);
    }
}
vb
Private Sub PivotGridControl_ShowFilterPopupExcel(ByVal sender As Object, ByVal e As FilterPopupExcelEventArgs)
    If e.Field = fieldModelPrice Then
        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)
    End If
End Sub

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 = falseIsRadioMode = true
csharp
private void PivotGridControl_ShowFilterPopupExcel(object sender, FilterPopupExcelEventArgs e) {
    if (e.Field == fieldTrademark) {
        e.IsRadioMode = true;
    }
}
vb
Private Sub PivotGridControl_ShowFilterPopupExcel(ByVal sender As Object, ByVal e As FilterPopupExcelEventArgs)
    If e.Field = fieldTrademark Then
        e.IsRadioMode = True
    End If
End Sub

See Also

PivotGridControl Class

PivotGridControl Members

DevExpress.XtraPivotGrid Namespace