Back to Devexpress

TreeViewControl.ShowingEditor Event

wpf-devexpress-dot-xpf-dot-grid-dot-treeviewcontrol-a27eb65c.md

latest1.9 KB
Original Source

TreeViewControl.ShowingEditor Event

Occurs before a node’s editor is opened. Allows you to prevent the activation of the editor.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public event TreeViewShowingEditorEventHandler ShowingEditor
vb
Public Event ShowingEditor As TreeViewShowingEditorEventHandler

Event Data

The ShowingEditor event's data class is DevExpress.Xpf.Grid.TreeList.TreeViewShowingEditorEventArgs.

Remarks

The following code sample prevents the activation of the root node’s editor.

xaml
<dxg:TreeViewControl x:Name="treeview"
                     ...
                     AllowEditing="True"
                     ShowingEditor="treeview_ShowingEditor"/>
csharp
void treeview_ShowingEditor(object sender, DevExpress.Xpf.Grid.TreeList.TreeViewShowingEditorEventArgs e) {
    e.Cancel = e.Node.Level == 0;
}
vb
Private Sub treeview_ShowingEditor(ByVal sender As Object, ByVal e As DevExpress.Xpf.Grid.TreeList.TreeViewShowingEditorEventArgs)
    e.Cancel = e.Node.Level = 0
End Sub

For more information, refer to the following help topic: Edit Data.

See Also

TreeViewControl Class

TreeViewControl Members

DevExpress.Xpf.Grid Namespace