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>
|
C# |
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
|
The GridControl provides the following events to process end user actions:
Event |
Description |
DataViewBase.GetIsEditorActivationAction |
Allows you to specify whether an action (key down, text input, or mouse left button click) activates the focused editor. |
ProcessEditorActivationAction |
Allows you to make the focused editor process an activation action. |
GetActiveEditorNeedsKey |
Allows you to specify whether an active editor responds to keys that end user presses. |