Skip to main content
All docs
V26.1
  • TreeViewControl.ProcessEditorActivationAction Event

    Allows you to specify whether the focused node should process an editor activation action.

    Namespace: DevExpress.Xpf.Grid

    Assembly: DevExpress.Xpf.Grid.v26.1.dll

    Declaration

    public event EventHandler<TreeViewProcessEditorActivationActionEventArgs> ProcessEditorActivationAction

    Event Data

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

    Property Description
    ActivationAction Gets the type of user action that triggered editor activation.
    Column Gets the column that contains the active editor cell.
    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.
    KeyDownEventArgs Gets key event data if the editor activation was triggered by a keystroke; otherwise, null.
    MouseLeftButtonEventArgs Gets mouse button event data if the editor activation was triggered by a mouse click; otherwise, null.
    OriginalSource Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
    RaiseEventAgain Gets or sets whether the event is raised again to force the focused editor process an activation action.
    RoutedEvent Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
    RowHandle Gets the handle of the row that contains the active editor cell.
    Source Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.
    TemplateChild Gets an in-place editor specified in a cell template.
    TextInputEventArgs Gets text input event data if the editor activation was triggered by text input; otherwise, null.
    Value Gets the current value in the active editor.

    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

    A user can do the following to activate an in-place editor for the focused node:

    • Click the required node
    • Press Enter
    • Press F2
    • Start typing

    Editor activation action occurs once. You can handle ProcessEditorActivationAction force the activated editor to process the same action additionally.

    To pass the activation action to the editor, do the following:

    1. Handle the ProcessEditorActivationAction event.
    2. Use e.ActivationAction / e.MouseLeftButtonEventArgs / e.KeyDownEventArgs / e.TextInputEventArgs properties to identify the action.
    3. Set e.RaiseEventAgain to true to raise the activation action again for the editor.

    Example: Pass Mouse Clicks to an In-Place Editor

    The following code snippet sets the RaiseEventAgain parameter to true when a user clicks a node to pass this click to the activated editor:

    <dx:ThemedWindow x:Class="TreeViewControlApp.MainWindow"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
                     xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
                     Title="TreeViewControl" Height="450" Width="600">
        <dxg:TreeViewControl x:Name="tree"
                             ChildNodesPath="Employees"
                             TreeViewFieldName="Name"
                             AllowEditing="True"
                             EditorShowMode="MouseUpFocused"
                             ProcessEditorActivationAction="OnProcessEditorActivationAction"/>
    </dx:ThemedWindow>
    
    private void OnProcessEditorActivationAction(object sender, TreeViewProcessEditorActivationActionEventArgs e) {
        if (e.ActivationAction == ActivationAction.MouseLeftButtonDown)
            e.RaiseEventAgain = true;
    }
    

    TreeViewControl fires the following events to process user actions that activate an in-place editor:

    GetIsEditorActivationAction
    Allows you to specify an action (key down, text input, or left mouse button click) to activate the focused editor.
    GetActiveEditorNeedsKey
    Allows you to specify whether the active editor responds to certain keystrokes.
    See Also