I'm using Virtual TreeView V5.0.1 (06 Sep 2012) in Delphi XE2. Setting CheckBox := True
on a header column property does not enables the checkbox, so here's the question, how do I enable checkboxes on column headers?
How to enable checkboxes in Virtual TreeView columns headers?
Asked Answered
The answer to this seemingly simple question brought a dozen of Google results that tried to hack the header drawing through OwnerDraw
and painting checkboxes manually.
Where's the solution I want to share is quite simple, enable following two items in IDE:
include hoShowImages
into VirtualTree.Header.Options
set and toCheckSupport
into VirtualTree.TreeOptions.MiscOptions
set.
Then you can enable Header.Column[0].CheckBox
property and see desired result.
Also, if you want to use the checkbox, say to select all items in a list, it goes under the header's OnClick. –
Sheik
© 2022 - 2024 — McMap. All rights reserved.