Skip to main content

LookUpEditBase.ProcessNewValue Event

Allows a new value entered into the edit box, to be added to the items source.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v24.2.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public event ProcessNewValueEventHandler ProcessNewValue

Event Data

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

Property Description
DisplayText Gets the text entered by an end-user within the editor’s edit box.
Handled Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. Inherited from RoutedEventArgs.
OriginalSource Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
PostponedValidation Gets or sets whether to postpone edit value validation.
RoutedEvent Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
Source Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.

The event data class exposes the following methods:

Method Description
InvokeEventHandler(Delegate, Object) When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation. Inherited from RoutedEventArgs.
OnSetSource(Object) When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes. Inherited from RoutedEventArgs.

Remarks

View Example: WPF LookUpEdit - Process New Values

If the editor cannot find an item that matches the text entered by an end-user within the edit box (ProcessNewValueEventArgs.DisplayText), the ProcessNewValue event occurs. Handle this event to manually validate a new value, and if required, add the corresponding record to a data source.

The ProcessNewValue event is raised after a new value has been validated, allowing you to add this value to the items source. By default, the validation occurs while typing within the editor’s text box (see BaseEdit.ValidateOnTextInput). As a result, the ProcessNewValue event is fired each time a user presses a keyboard key.

The ProcessNewValue event occurs if an end-user presses the Enter key (the BaseEdit.ValidateOnEnterKeyPressed property should be set to true) or moves focus to another control.

If you add a new record, set the event parameter’s Handled property to true.

Note

If you want to show a floating container allowing an end-user to specify other values for a new record, set the event parameter’s ProcessNewValueEventArgs.PostponedValidation property to true. In this instance, a new value will be validated after a floating container is closed.

See Also