Skip to main content

Column Chooser

  • 2 minutes to read

The Column Chooser allows users to hide and display columns and bands. To display the Column Chooser, a user should select the Show Column/Band chooser option in the column’s header context menu:

Column Chooser

The Column Chooser window contains column and band headers and check boxes. Each check box visualizes the BaseColumn.Visible property of the corresponding column or band. Set the BaseColumn.ShowInColumnChooser property to false to hide a column/band from the Column Chooser window.

The table below lists the main properties that affect element behavior and appearance:

Characteristics Members
Column Chooser Control ExtendedColumnChooserControl
Show and Hide DataViewBase.ShowColumnChooser, DataViewBase.ShownColumnChooser, DataViewBase.HideColumnChooser, DataViewBase.HiddenColumnChooser, DataViewBase.IsColumnChooserVisible
Template DataViewBase.ExtendedColumnChooserTemplate
Column Header Template DataViewBase.ColumnHeaderTemplate
Header Caption ColumnBase.ColumnChooserHeaderCaption

The GridControl displays the Column Chooser in a separate window. To add the Column Chooser to the same window as the GridControl, create an ExtendedColumnChooserControl object:

WPF Standalone Column Chooser

View Example: Display a Standalone Column Chooser

  1. Users can open the Column Chooser window from a column header’s context menu. To prevent this, remove the Show Column/Band Chooser button from the menu:

    Remove a Column Chooser from the Context Menu

    The following code snippet removes the Show Column/Band Chooser / Hide Column/Band Chooser option from the column’s header context menu:

    <ThemedWindow ...
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars">
        <dxg:GridControl ... >
            <dxg:GridControl.View>
                <dxg:TableView x:Name="tableView">
                    <dxg:TableView.ColumnMenuCustomizations>
                        <dxb:RemoveAction ElementName="{x:Static dxg:DefaultColumnMenuItemNames.ColumnChooser}"/>
                    </dxg:TableView.ColumnMenuCustomizations>
                </dxg:TableView>
            </dxg:GridControl.View>
        </dxg:GridControl>
    </ThemedWindow>
    
  2. Add a Column Chooser to the window:

    <dxg:ExtendedColumnChooserControl Owner="{Binding ElementName=view}"
                                      FlowDirection="{Binding Owner.FlowDirection, 
                                                      RelativeSource={RelativeSource Self}}"/>
    

Keyboard Navigation

You can use arrow keys to navigate between column names in the Column Chooser. Press the Space key to select/clear the focused column’s checkbox and display/hide columns in the Data Grid.

See Also