Back to Devexpress

DataViewBase.GetIsEditorActivationAction Event

wpf-devexpress-dot-xpf-dot-grid-dot-dataviewbase-a00dd7b5.md

latest8.5 KB
Original Source

DataViewBase.GetIsEditorActivationAction Event

Allows you to specify whether an action (key down, text input, or mouse left button click) activates the focused editor.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public event EventHandler<GetIsEditorActivationActionEventArgs> GetIsEditorActivationAction
vb
Public Event GetIsEditorActivationAction As EventHandler(Of GetIsEditorActivationActionEventArgs)

Event Data

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

PropertyDescription
ActivationActionGets an activation action’s type. Inherited from ActivationActionEventArgsBase.
ColumnGets or sets a grid column, for which an event has been raised. Inherited from EditorEventArgsBase.
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.
IsActivationActionGets or sets whether the action activates the focused cell’s editor.
KeyDownEventArgsEvent arguments for the KeyDown activation action. Inherited from ActivationActionEventArgsBase.
MouseLeftButtonEventArgsEvent arguments for the MouseLeftButton activation action. Inherited from ActivationActionEventArgsBase.
OriginalSourceGets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
RowHandleGets or sets the row handle, for which an event has been raised. Inherited from EditorEventArgsBase.
SourceGets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.
TemplateChildAn in-place editor specified in a cell template. Inherited from ActivationActionEventArgsBase.
TextInputEventArgsEvent arguments for the TextInput activation action. Inherited from ActivationActionEventArgsBase.
ValueGets the edit value stored in the editor, for which an event has been raised. Inherited from EditorEventArgsBase.

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

The following code sample shows how to prohibit end users from activating an editor using the mouse:

xaml
<dxg:GridControl AutoGenerateColumns="AddNew" EnableSmartColumnsGeneration="True" ItemsSource="{Binding Items}" SelectionMode="Cell">
    <dxg:GridColumn FieldName="Country"/>
    <dxg:GridColumn FieldName="City">
        <dxg:GridColumn.CellTemplate>
            <DataTemplate>
                <dxe:ListBoxEdit x:Name="PART_Editor" ItemsSource="{Binding RowData.Row.Cities}" />
            </DataTemplate>
        </dxg:GridColumn.CellTemplate>
    </dxg:GridColumn>
    <dxg:GridControl.View>
        <dxg:TableView GetIsEditorActivationAction="GetIsEditorActivationAction" />
    </dxg:GridControl.View>
</dxg:GridControl>
csharp
private void GetIsEditorActivationAction(object sender, DevExpress.Xpf.Grid.GetIsEditorActivationActionEventArgs e) {
    if (e.ActivationAction == ActivationAction.MouseLeftButtonDown)
        e.IsActivationAction = false;
}
vb
Private Sub GetIsEditorActivationAction(ByVal sender As Object, ByVal e As DevExpress.Xpf.Grid.GetIsEditorActivationActionEventArgs)
    If e.ActivationAction = ActivationAction.MouseLeftButton Then e.IsActivationAction = False
End Sub

Process End User Actions

The GridControl provides the following events to process end user actions:

EventDescription
DataViewBase.GetIsEditorActivationActionAllows you to specify whether an action (key down, text input, or mouse left button click) activates the focused editor.
DataViewBase.ProcessEditorActivationActionAllows you to make the focused editor process an activation action.
DataViewBase.GetActiveEditorNeedsKeyAllows you to specify whether an active editor responds to keys that a user presses.

See Also

Assign Editors to Cells

DataViewBase Class

DataViewBase Members

DevExpress.Xpf.Grid Namespace