Back to Devexpress

ColumnBase.AllowColumnFiltering Property

wpf-devexpress-dot-xpf-dot-grid-dot-columnbase-123865d9.md

latest4.5 KB
Original Source

ColumnBase.AllowColumnFiltering Property

Gets or sets whether a user can filter data by the column. This is a dependency property.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public DefaultBoolean AllowColumnFiltering { get; set; }
vb
Public Property AllowColumnFiltering As DefaultBoolean

Property Value

TypeDescription
DefaultBoolean

A DefaultBoolean enumeration value that specifies whether a user can filter data by the column.

|

Available values:

NameDescriptionReturn Value
True

The value is true.

|

0

| | False |

The value is false.

|

1

| | Default |

The value is specified by a global option or a higher-level object.

|

2

|

Remarks

The GridControl allows users to filter data if the DataViewBase.AllowColumnFiltering property is set to true.

Individual columns include the AllowColumnFiltering property that allows you to overwrite the behavior specified by the view. This can be useful when it is required to prevent a user from invoking the filter dropdown of individual columns:

xaml
<dxg:GridControl.Columns>
    <dxg:GridColumn FieldName="OID" Header="Id" />
    <dxg:GridColumn FieldName="From" />
    <dxg:GridColumn FieldName="AnimationElement" 
                    UnboundDataType="{x:Type sys:Object}" 
                    Visible="False" 
                    ShowInColumnChooser="False" 
                    AllowColumnFiltering="False" />
</dxg:GridControl.Columns>

Note

The AllowColumnFiltering property does not affect the availability of the Automatic Filter Row. To control the availability of the Automatic Filter Row , use the ColumnBase.AllowAutoFilter property.

If the AllowColumnFiltering property is set to Default , the ability to filter data is controlled by the view’s DataViewBase.AllowColumnFiltering property. In this case, use the ColumnBase.ActualAllowColumnFiltering property to get whether a user can filter data by the current column.

Tip

Topic : Drop-down Filter

Run Demo: Filtering

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

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.

wpf-data-grid-bind-to-custom-service-with-restrictions/CS/MainWindow.xaml#L25

xml
AllowedDateTimeFilters="SingleDateRange" FilterPopupMode="DateSmart"
            AllowColumnFiltering="{DXBinding '$dxu:DefaultBooleanExtension.ToDefaultBoolean(!@e(hotColumn).IsSorted and !@e(weekColumn).IsSorted)'}">
<dxg:GridColumn.EditSettings>

See Also

AllowColumnFiltering

ActualAllowColumnFiltering

ColumnBase Class

ColumnBase Members

DevExpress.Xpf.Grid Namespace