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

TreeListOptionsHtmlTemplate.UpdateNodeTemplateOnFocusChanged Property

Gets or sets whether to raise the QueryNodeTemplate event when the focused node changes.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v24.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList

#Declaration

[DefaultValue(false)]
[XtraSerializableProperty]
public bool UpdateNodeTemplateOnFocusChanged { get; set; }

#Property Value

Type Default Description
Boolean false

true to raise the QueryNodeTemplate event when the focused node changes; otherwise, false.

#Property Paths

You can access this nested property as listed below:

Object Type Path to UpdateNodeTemplateOnFocusChanged
TreeList
.OptionsHtmlTemplate .UpdateNodeTemplateOnFocusChanged

#Remarks

The following example demonstrates how to apply different HTML and CSS templates to regular and focused nodes:

treeList1.OptionsHtmlTemplate.UpdateNodeTemplateOnFocusChanged = true;
treeList1.QueryNodeTemplate += treeList1_QueryNodeTemplate;

// ...
private void treeList1_QueryNodeTemplate(object sender, QueryNodeTemplateEventArgs e) {
    if (e.Node.Focused) {
        /* Applies 'focusedNodeTemplate' if the node is focused.
           Otherwise, the default HTML and CSS template is used (treeList1.NodeHtmlTemplate).
           'focusedNodeTemplate' is stored in the treeList1.HtmlTemplates collection.
        */
        e.Template.Assign(focusedNodeTemplate);
    }
}

Read the following topic for detailed information: HTML and CSS Templates.

Run Demo

See Also