TreeList.QueryNodeTemplate Event
Allows you to assign HTML-CSS templates from the HtmlTemplates collection to nodes.
Namespace: DevExpress.XtraTreeList
Assembly: DevExpress.XtraTreeList.v24.2.dll
Declaration
Event Data
The QueryNodeTemplate event's data class is DevExpress.XtraTreeList.QueryNodeTemplateEventArgs.
Remarks
Handle the QueryNodeTemplate
event to apply a template from the HtmlTemplates collection based on a condition.
using DevExpress.XtraTreeList;
using DevExpress.HTML.Demos.Modules.TreeList;
// ...
EditingComment editingComment;
private void treeList1_QueryNodeTemplate(object sender, QueryNodeTemplateEventArgs e) {
var comment = treeList1.GetRow(e.Node.Id);
if(editingComment != null && editingComment.Comment == comment) {
if(editingComment.Mode == CommentEditingMode.Editing)
e.Template.Assign(editCommentTemplate);
else
e.Template.Assign(replyCommentTemplate);
}
}
The NodeHtmlTemplate property specifies the default HTML-CSS template for nodes.
See Also