Back to Devexpress

LookUpEditBase.ProcessNewValue Event

wpf-devexpress-dot-xpf-dot-editors-dot-lookupeditbase-fd633686.md

latest5.8 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public event ProcessNewValueEventHandler ProcessNewValue
vb
Public Event ProcessNewValue As ProcessNewValueEventHandler

Event Data

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

PropertyDescription
DisplayTextGets the text entered by an end-user within the editor’s edit box.
HandledGets 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.
OriginalSourceGets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
PostponedValidationGets or sets whether to postpone edit value validation.
RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
SourceGets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.

The event data class exposes the following methods:

MethodDescription
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

AddNewButtonPlacement

LookUpEditBase Class

LookUpEditBase Members

DevExpress.Xpf.Editors Namespace