# TreeviewItem Custom Component loss of functionality

**URL:** <https://forum.juce.com/t/treeviewitem-custom-component-loss-of-functionality/39824>\
**Category:** General JUCE discussion\
**Created:** [June 2, 2020, 1:07pm UTC](https://forum.juce.com/t/treeviewitem-custom-component-loss-of-functionality/39824 "2020-06-02T13:07:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomash1](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@thomash1](https://forum.juce.com/u/thomash1)\
**Post date:** [June 2, 2020, 1:07pm UTC](https://forum.juce.com/t/treeviewitem-custom-component-loss-of-functionality/39824/1 "2020-06-02T13:07:53Z")

</div>

Hey guys,

So I have got a Treeview within my project which has worked well when creating the Treeview Items with paintItem().

I’m now in a position where I have needed to use the CreateItemComponent() function as I needed to contain custom buttons within my treeview item components. The issue with this is by moving to CreateItemComponent I have lost the functionality of dragging and dropping as well as holding ctrl and multi selecting items of the treeview. Does anyone have any suggestions as to how to remedy this, are there calls I’m missing as i’m now using a custom component?

Thankyou!

---

<div class="post-metadata">

**Author:** ![rebbur](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@rebbur](https://forum.juce.com/u/rebbur)\
**Post date:** [June 2, 2020, 7:33pm UTC](https://forum.juce.com/t/treeviewitem-custom-component-loss-of-functionality/39824/2 "2020-06-02T19:33:13Z")

</div>

Try using setInterceptsMouseClicks(false, true) on your customComponent. This way the mouse interaction on the component itself is passed on to the tree, the buttons on your custom component will still work.
