Question

How to copy between two virtualtreeview to copy all columns, not just the first one?

before copy:

enter image description here

after copy: enter image description here

Was it helpful?

Solution

The tree control holds no data. It doesn't contain the column data you want to show, so it has no way of copying it. Rather, when the tree control wants to display data for any cell, it asks your program what to display by triggering the OnCellText event. It displays whatever your program tells it to.

If your copied-to control isn't displaying what you want, then it's because your OnCellText event handler for that control isn't giving it the necessary data.

When you copy a node, it's your responsibility to ensure that the information associated with the source node gets stored somewhere such that the destination control's OnCellText event knows where to find it for the destination node. There are any number of ways to do that. It all depends on how you're copying the node in the first place, and how you're representing your underlying data structure that the OnCellText event uses. Within those constraints, you can do it any way you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top