windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-columnview-7e77d8bb.md
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.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
[DXCategory("Behavior")]
public event FilterPopupExcelEventHandler ShowFilterPopupExcel
<DXCategory("Behavior")>
Public Event ShowFilterPopupExcel As FilterPopupExcelEventHandler
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 FilterPopupEventArgs. |
| DefaultFilterType | Gets or sets the operator selected by default in the Filters tab. |
| IsRadioMode | Gets or sets whether single (the radio mode) or multiple values can be selected simultaneously in the Values tab. |
| ShowAdvancedDatePeriods | Gets or sets whether to show advanced date periods (Year to Date, All Dates in the Period). |
| ShowAggregates | Gets or sets whether to show filters for aggregates (Below Average, Above Average, etc.). |
| ShowBlanks | Gets or sets whether to show the IsBlank and IsNotBlank filter conditions. |
| ShowComparisons | Gets or sets whether to show comparison filter conditions (Greater Than, Less Than, etc.). |
| ShowConditionalFilters | Gets or sets whether to display the Conditional Format Filters item in the filter popup. |
| ShowCustomFilters | Gets or sets whether to show the Custom Filters. |
| 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 option in the Filters tab. |
| ShowSequences | Gets or sets whether to show filters for sequences (Top N, Bottom N, etc.). |
| ShowTimePeriods |
The event data class exposes the following methods:
| Method | Description |
|---|---|
| HideFilter(CustomUIFilterType) | Hides an operator from the Filters tab. |
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;
}
Private Sub gridView1_ShowFilterPopupExcel(ByVal sender As Object, ByVal e As FilterPopupExcelEventArgs)
e.ShowNulls = False
End Sub
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);
}
}
Private Sub gridView1_ShowFilterPopupExcel(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Grid.FilterPopupExcelEventArgs)
If e.Column.FieldName = "UnitPrice" 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
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:
ExcelFilterOptions.Default.ShowNulls = false;
ExcelFilterOptions.Default.ShowNulls = False
See Also