How to: Customize Filter Items within a Column's Filter Dropdown

  • 3 minutes to read

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:


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

<Window x:Class="DXGrid_CustomizingFilterDropdown.Window1" 
        Title="Window1" Height="300" Width="535">

        <dxg:GridControl x:Name="grid" ItemsSource="{Binding AccountList}">
                <dxg:GridColumn FieldName="UserName"/>
                <dxg:GridColumn FieldName="RegistrationDate" FilterPopupMode="List"/>
                <dxg:TableView AutoWidth="True" ShowFilterPopup="TableView_ShowFilterPopup" />