windowsforms-devexpress-dot-xtragrid-dot-columns-dot-optionscolumnfilter-369d720d.md
Gets or sets whether to display the filter button within the column’s header (field filter button in Layout Views).
Namespace : DevExpress.XtraGrid.Columns
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
[DefaultValue(true)]
[XtraSerializableProperty]
public virtual bool AllowFilter { get; set; }
<DefaultValue(True)>
<XtraSerializableProperty>
Public Overridable Property AllowFilter As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | true |
true to display the filter button within the column’s header; otherwise, false.
|
You can access this nested property as listed below:
| Object Type | Path to AllowFilter |
|---|---|
| GridColumn |
.OptionsFilter .AllowFilter
|
The AllowFilter property specifies whether the filter button is visible for an individual column. To apply this setting to all columns, use the View’s OptionsCustomization.AllowFilter property.
// Display the filter button for all columns in gridView1.
gridView1.OptionsCustomization.AllowFilter = true;
// Hide the filter button for the ID column.
gridView1.Columns["ID"].OptionsFilter.AllowFilter = false;
Note
If the View’s OptionsCustomization.AllowFilter option is disabled, the column’s OptionsFilter.AllowFilter property has no effect.
When the View generates columns automatically from business objects, you can disable filter UI using the Display attribute’s AutoGenerateFilter property:
[Display(AutoGenerateFilter = false)]
public string Email { get; set; }
<Display(AutoGenerateFilter:= False)>
Public Property Email() As String
See the following help topic for additional information: Data Annotation Attributes.
The following code snippets (auto-collected from DevExpress Examples) contain references to the AllowFilter 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.
buttonColumn.OptionsColumn.ShowInCustomizationForm = false;
buttonColumn.OptionsFilter.AllowFilter = false;
InitButtonEditor(ref activeRepositoryItemButtonEdit, true);
winforms-grid-display-editors-in-columns-headers/CS/WindowsApplication1/Form1.cs#L35
gridColumn1.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
gridColumn1.OptionsFilter.AllowFilter = false;
new ColumnInplaceEditorHelper(gridColumn2, new RepositoryItemSpinEdit());
winforms-grid-display-editors-in-columns-headers/VB/Form1.vb#L34
gridColumn1.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False
gridColumn1.OptionsFilter.AllowFilter = False
helper = New ColumnInplaceEditorHelper(gridColumn2, New RepositoryItemSpinEdit())
See Also
GridOptionsCustomization.AllowFilter