Skip to main content
All docs
V24.1

TreeListOptionsHtmlTemplate.UpdateNodeTemplateOnFocusChanged Property

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

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v24.1.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