Check documentation for the latest version of dhtmlxSuite Tree(TreeGrid) Specific HowTos DHTMLX Docs

Tree(TreeGrid) Specific HowTos

How can I mark an item as a leaf or a branch of the tree?

In the RequestHasChildren event handler you are allowed to mark an item as a leaf or a branch. For this purpose, you should use the HasChildren property and set it to true or false. true marks an item as a branch, false - as a leaf.

dhtmlxTreeGridConnector connector = new dhtmlxTreeGridConnector(/*...*/);
connector.RequestHasChildren += new EventHandler<RequestChildrenEventArgs<dhtmlxTreeGridDataItem>>(
void connector_RequestHasChildren(object sender,RequestChildrenEventArgs<dhtmlxTreeGridDataItem> e)
    if (TodayIsMonday)
        e.HasChildren = false;//no children on Mondays
        e.HasChildren = true;

For more details see the 'Tree/TreeGrid specific' chapter in the 'Dynamic loading' guide.

Back to top