windowsforms-devexpress-dot-xtraeditors-dot-filtercontrol-2b121ba9.md
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
[DXCategory("Events")]
public event EventHandler<CustomValueEditorArgs> CustomValueEditorForEditing
<DXCategory("Events")>
Public Event CustomValueEditorForEditing As EventHandler(Of CustomValueEditorArgs)
The CustomValueEditorForEditing event's data class is CustomValueEditorArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| ElementIndex | |
| Node | |
| Operation | |
| PropertyName | Gets the name of the current property (column/field). Inherited from BaseNodeEventArgs. |
| PropertyType | Gets the type of the current property (column/field). Inherited from BaseNodeEventArgs. |
| RepositoryItem | |
| Value |
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.
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;
}
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