9

I am using TVirtualTreeView as an excellent alternative to the old TStringgrid.

On one feature that I am missing though, is the possibility to make selections of an any area of cells (other than a single column, row or the whole area).

I can not find any solution to this, does anyone have a suggestion?

Tool
  • 419
  • 2
  • 8
  • You can set the selected[] property for each and every Node (row). In the Header can you set which columns are selected. Set Multiselect to true in the options. – Ritsaert Hornstra Dec 07 '11 at 14:20
  • I have tried, but I can not select multiple columns. There is no options in TVirtualTreeColumn.Option or in TVirtualTreeColumns. – Tool Dec 07 '11 at 14:44
  • 2
    There is no such feature in VT. But you can handle this by your own in your data structure (e.g. as a bit mask, where each bit will represent one column and state if it's selected or not). And this mask you can change in a certain column click event and draw it in a some cell draw event. – TLama Dec 07 '11 at 14:55
  • Thanks! i have thought of the same solution too, but right now I havn't the time on my current project. It would be interesting if anyone already has made the implementation in a component of their own. What made me curious is the feature to mark an area with the mouse pressed down - There will be a blue (transparent) rectangle over the cells but for what reason? If I take the time to implement a selection treeview I will put up the code for review.. – Tool Dec 07 '11 at 18:33
  • 1
    How about http://stackoverflow.com/questions/491198/is-it-possible-to-select-multiple-columns-in-virtual-treeview? – Galdur Feb 27 '12 at 20:24

1 Answers1

0

You Can Use Canvas Draw For Show Own Selection Area of Cell.

mehdi lotfi
  • 11,194
  • 18
  • 82
  • 128