Back to Devexpress

FilterControl.ValueEditorShown Event

windowsforms-devexpress-dot-xtraeditors-dot-filtercontrol-0d12de5d.md

latest3.6 KB
Original Source

FilterControl.ValueEditorShown Event

Fires after an operand’s editor has been displayed.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event EventHandler<ValueEditorEventArgs> ValueEditorShown
vb
<DXCategory("Events")>
Public Event ValueEditorShown As EventHandler(Of ValueEditorEventArgs)

Event Data

The ValueEditorShown event's data class is ValueEditorEventArgs. The following properties provide information specific to this event:

PropertyDescription
EditorGets the currently processed editor.
PropertyNameGets the name of the current property (column/field). Inherited from BaseNodeEventArgs.
PropertyTypeGets the type of the current property (column/field). Inherited from BaseNodeEventArgs.

Remarks

The ValueEditorShown event fires after the editor used to edit a value operand is invoked. Handle this event to customize the editor’s settings.

Example

The following code snippet handles the FilterControl.ValueEditorShown event to change the foreground color of operand editors in the Data Grid’s embedded Filter Control.

The ColumnView.FilterEditorCreated event is used to subscribe to the ValueEditorShown event.

csharp
using DevExpress.XtraEditors.Filtering;
using DevExpress.XtraGrid.Views.Base;

private void gridView1_FilterEditorCreated(object sender, FilterControlEventArgs e) {
    e.FilterEditor.ValueEditorShown += FilterEditor_ValueEditorShown;
}

private void FilterEditor_ValueEditorShown(object sender, ValueEditorEventArgs e) {
    e.Editor.Properties.Appearance.ForeColor = Color.Red;
}
vb
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraEditors.Filtering

Private Sub GridView1_FilterEditorCreated(ByVal sender As System.Object, ByVal e As FilterControlEventArgs) _
Handles GridView1.FilterEditorCreated
    AddHandler e.FilterControl.ValueEditorShown, AddressOf FilterControl_ValueEditorShown
End Sub

Private Sub FilterControl_ValueEditorShown(ByVal sender As Object, ByVal e As ValueEditorEventArgs)
    e.Editor.Properties.Appearance.ForeColor = Color.Red
End Sub

See Also

CustomValueEditor

CustomValueEditorForEditing

FilterControl Class

FilterControl Members

DevExpress.XtraEditors Namespace