Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeViewControl.NodeTemplate Property

Gets or sets the template that defines the node appearance. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public DataTemplate NodeTemplate { get; set; }

#Property Value

Type Description
DataTemplate

The template that defines the node appearance. The template’s data context is a TreeViewRowData object.

#Remarks

You can display custom content in data nodes. The NodeTemplate property allows you to specify the template that defines the appearance of data nodes.

If you have more than one node template, use the TreeViewControl.NodeTemplateSelector property to implement custom logic to choose the required template.

If you specify both the NodeTemplate and TreeViewControl.NodeTemplateSelector, the TreeViewControl uses the template returned by the template selector.

If the template selector returns null, the TreeViewControl uses the template specified by the NodeTemplate property.

See Also