ColumnView.ShowFilterPopupExcel Event
Allows you to hide specific filter conditions from Filters and Values tabs of the Excel-style Drop-down Filter.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v24.2.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
#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 |
---|---|
Column |
Gets the grid column being processed.
Inherited from Filter |
Default |
Gets or sets the operator selected by default in the Filters tab. |
Is |
Gets or sets whether single (the radio mode) or multiple values can be selected simultaneously in the Values tab. |
Show |
Gets or sets whether to show advanced date periods (Year to Date, All Dates in the Period). |
Show |
Gets or sets whether to show filters for aggregates (Below Average, Above Average, etc.). |
Show |
Gets or sets whether to show the Is |
Show |
Gets or sets whether to show comparison filter conditions (Greater Than, Less Than, etc.). |
Show |
Gets or sets whether to show the Custom Filters. |
Show |
Gets or sets whether to show date periods (Specific Date Periods, Today, Last Month, Year to Date, etc.). |
Show |
Gets or sets whether to show the Filters tab. |
Show |
Gets or sets whether to show the pattern-matching (Is Like, Is Not Like) operators for string values. |
Show |
Gets or sets whether to show the Is Null and Is Not Null filter conditions. |
Show |
Gets or sets whether to show the Predefined Filters option in the Filters tab. |
Show |
Gets or sets whether to show filters for sequences (Top N, Bottom N, etc.). |
Show |
The event data class exposes the following methods:
Method | Description |
---|---|
Hide |
Hides an operator from the Filters tab. |
#Remarks
The ShowFilterPopupExcel
event allows you to hide specific predefined conditions from the Filters tab of the Excel-style Drop-down Filter. For instance, this tab contains the Is Null and Is Not Null filter conditions:
The following code snippet hides these conditions from the Filters tab:
void gridView1_ShowFilterPopupExcel(object sender, FilterPopupExcelEventArgs e) {
e.ShowNulls = false;
}
You can use the e.HideFilter method to hide specific conditions:
void gridView1_ShowFilterPopupExcel(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupExcelEventArgs e) {
if (e.Column.FieldName == "UnitPrice") {
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);
}
}
Instead of the ShowFilterPopupExcel
event, you can also use related static properties accessible through the DevExpress.Utils.Filtering.ExcelFilterOptions.Default
field. These properties allow you to hide filter conditions for all Data Grid controls in the application: