Back to Devexpress

FilterControl.CustomValueEditorForEditing Event

windowsforms-devexpress-dot-xtraeditors-dot-filtercontrol-2b121ba9.md

latest4.2 KB
Original Source

FilterControl.CustomValueEditorForEditing Event

Allows you to specify a custom editor used to edit an operand. Handle the FilterControl.CustomValueEditor event to specify an editor used to display and edit the operand.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

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

Event Data

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

PropertyDescription
ElementIndex
Node
Operation
PropertyNameGets the name of the current property (column/field). Inherited from BaseNodeEventArgs.
PropertyTypeGets the type of the current property (column/field). Inherited from BaseNodeEventArgs.
RepositoryItem
Value

Remarks

The FilterControl.CustomValueEditor event allows you to assign a custom editor to a value operand. This editor is used to display and edit the operand.

Handle the CustomValueEditorForEditing event to specify an editor that is only used to edit an operand. To assign an editor to an operand, create a corresponding RepositoryItem descendant, and set the RepositoryItem event parameter.

Example

csharp
readonly RepositoryItemCalcEdit calcEdit = new RepositoryItemCalcEdit();

private void gridView1_FilterEditorCreated(object sender, FilterControlEventArgs e) {
    e.FilterEditor.CustomValueEditorForEditing += FilterEditor_CustomValueEditorForEditing;
}
private void FilterEditor_CustomValueEditorForEditing(object sender, CustomValueEditorArgs e) {
    if (e.Node.FirstOperand.PropertyName != "Payment") return;
    e.RepositoryItem = calcEdit;
}
vb
Private ReadOnly calcEdit As New RepositoryItemCalcEdit()

Private Sub gridView1_FilterEditorCreated(ByVal sender As Object, ByVal e As FilterControlEventArgs) Handles gridView1.FilterEditorCreated
    AddHandler e.FilterControl.CustomValueEditorForEditing, AddressOf FilterControl_CustomValueEditorForEditing
End Sub

Private Sub FilterControl_CustomValueEditor(ByVal sender As Object, ByVal e As CustomValueEditorArgs)
    If e.Node.FirstOperand.PropertyName <> "Payment" Then
        Return
    End If
    e.RepositoryItem = calcEdit
End Sub

See Also

CustomValueEditor

ValueEditorShown

FilterControl Class

FilterControl Members

DevExpress.XtraEditors Namespace