The standard behavior of the Mendix tree node widget is to expand or collapse when the entire row is clicked.
there isn't a built-in way to modify this behavior to only respond when the icon is clicked.
As for the dropdown container in the header tree node, if it is triggering the expand/collapse action of the tree node, you might need to adjust the z-index of the dropdown container or the tree node. If the tree node has a higher z-index than the dropdown container, it will take precedence when clicked. Adjusting the z-index of the dropdown container to be higher than the tree node should prevent the tree node from responding to clicks on the dropdown.
Hi Deniel , for this you will need jquery.
for more information you can see here