Besides moving a TreeColumn to reorder columns in Tree, is there a way I can drag the header and drop it somewhere?
I have a TreeViewer that allows user to dynamically change the tree structure by dragging and dropping parent nodes around, moving the node above or below another node. I'd like to allow the user to drag a column header and drop it onto the tree, creating a grouping node for the field represented by that particular dragged column. If I could get the drag to work, I know how to do the rest. I'm just not sure how to actually get a drag event from a Tree Column.
Is it possible? All I need is the Column's text, I could do the rest from there...
But beside that, please ask yourself, whether this would be an intuitive approach. Without your explanation I would not understand what could happen when dragging a table header onto a tree node. My suggestion: try to rethink about a more intuitive way to do what you intent.
Imagine a tree being used like a Pivot Table in Excel. The structure of the tree is a data grouping relationship. Let's say it's financial data and the current tree structure has Sector as a parent and child nodes for each Sector. Now picture Subsector being a column. Maybe the user wants to add a SubSector grouping to the tree structure, under the Sector level. Dragging the SubSector column and dropping it on a Sector node could tell the code to create a SubSector Grouping below the Sector level and refresh the tree structure, now showing the data grouped by both Sector and SubSector. Just like a Pivot Table