ColumnView.FilterEditorCreated Event
Allows you to customize the Filter Editor before it is displayed on screen.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v24.2.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
#Declaration
[DXCategory("Behavior")]
public event FilterControlEventHandler FilterEditorCreated
#Event Data
The FilterEditorCreated event's data class is FilterControlEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Context |
Provides access to the Expression |
Filter |
Gets the form that displays the Filter Control. |
Filter |
Gets the Filter Control that displays filter criteria. This property returns null if the Column |
Filter |
Gets the Filter |
Filter |
Inherited from Base |
IFilter |
Gets the Filter Control that displays filter criteria. |
IFilter |
Provides access to the currently used Filter Control (Filter |
Show |
Gets or sets whether to display the Filter Editor (the form that embeds the Filter Editor).
Inherited from Base |
#Remarks
Use the FilterEditorCreated event to customize the Filter Editor, or prevent it from being displayed. The event fires each time the Filter Editor is to be displayed on screen.
#Example
This example handles the FilterControl.CustomValueEditor event to assign custom editors (Spin Editor and Calc Editor) to value operands in Data Grid’s embedded FilterControl.
The Data Grid’s ColumnView.FilterEditorCreated
event is used to subscribe to the FilterControl.CustomValueEditor event.
private void gridView1_FilterEditorCreated(object sender, FilterControlEventArgs e) {
e.FilterEditor.CustomValueEditor += FilterEditor_CustomValueEditor;
}
readonly RepositoryItemSpinEdit spinEdit = new RepositoryItemSpinEdit();
readonly RepositoryItemCalcEdit calcEdit = new RepositoryItemCalcEdit();
private void FilterEditor_CustomValueEditor(object sender, CustomValueEditorArgs e) {
if (e.Node.FirstOperand.PropertyName != "Payment") return;
RepositoryItemTextEdit item = null;
if (e.ElementIndex == 2)
item = spinEdit;
else
item = calcEdit;
var settings = item.MaskSettings.Configure<MaskSettings.Numeric>();
settings.MaskExpression = "c";
e.RepositoryItem = item;
}
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FilterEditorCreated event.
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.