Skip to main content
A newer version of this page is available. .

DataControlBase.ClearColumnFilter(ColumnBase) Method

Removes the filter condition applied to the specified column.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v20.2.Core.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Grid.Core, DevExpress.Wpf.Grid.Core

Declaration

public void ClearColumnFilter(
    ColumnBase column
)

Parameters

Name Type Description
column ColumnBase

A ColumnBase descendant that represents the column whose filter is cleared.

Remarks

To clear the grid’s filter, set the DataControlBase.FilterCriteria property to null or the DataControlBase.FilterString property to an empty string.

To learn more, see Regular and Checked Drop-down Filters.

Example

This example shows how to replace the Date column’s drop-down filter items with custom items:

  • (All) - Cancels filtering
  • Registered in 2008 - Shows users that were registered in 2008
  • Registered in 2009 - Shows users that were registered in 2009

The image below shows the result:

exCustomizeFilterDropdown

View Example: How to customize filter items within a column's Filter Dropdown

<Window x:Class="DXGrid_CustomizingFilterDropdown.Window1" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        Title="Window1" Height="300" Width="535">
    <Grid>

        <dxg:GridControl x:Name="grid" ItemsSource="{Binding AccountList}">
            <dxg:GridControl.Columns>
                <dxg:GridColumn FieldName="UserName"/>
                <dxg:GridColumn FieldName="RegistrationDate" FilterPopupMode="List"/>
            </dxg:GridControl.Columns>
            <dxg:GridControl.View>
                <dxg:TableView AutoWidth="True" ShowFilterPopup="TableView_ShowFilterPopup" />
            </dxg:GridControl.View>
        </dxg:GridControl>
    </Grid>
</Window>
See Also