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

ColumnChooserControl Class

The legacy Column Chooser control allows users to show and hide the GridControl‘s columns at runtime.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v19.2.dll

Declaration

public class ColumnChooserControl :
    GridColumnChooserControlBase

Remarks

The GridControl displays the Column Chooser in a separate window. To add the Column Chooser to the same window as the GridControl, create a ColumnChooserControl object. This object is the Column Chooser which DataViewBase.ColumnChooserColumnDisplayMode property is set to ShowHiddenColumnsOnly:

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

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

    <dxg:ColumnChooserControl x:Name="PART_ColumnChooserControl"
                              Owner="{Binding ElementName=TableView}"
                              Columns="{Binding Path=Owner.ColumnChooserColumns, RelativeSource={RelativeSource Self}}"
                              DragText="Drag a column here to customize layout"/>
    

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ColumnChooserControl class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
DispatcherObject
DependencyObject
Visual
UIElement
FrameworkElement
Control
ColumnChooserControlBase
DevExpress.Xpf.Grid.GridColumnChooserControlBase
ColumnChooserControl
See Also