I am using a VirtualStringTree control as a list view and using the sort features. However when I double click the VirtualStringTree header the sort direction symbol hides until I click the header again.
Can that behaviour be disabled?
Things that I have tried but do not work:
- I have searched the properties and cannot find a related setting
- I have linked the double click header event to the click header event
My environment is Delphi 2007 Pro, Windows 7 Pro 64bit.
I had the same issue with double-click and hiding of sorting triangle and instead I just wanted a simple toggle up/down with nothing else. This issue is present unfortunately in latest VirtualTreeView (4.8.7) as well.
Here is a bit of code that fixes the issue – put something like this in your
OnHeaderClickevent (notOnHeaderDblClick!).The relevant line is
if HitInfo.Column = NoColumn then Exit;which fixes the double-click problem. You may or may not use the rest of code for your own purposes but it may be useful to someone else. The rest of explanation is in the code comments.You don’t need to define OnHeaderDblClick event – it may be empty if not needed so you may want to remove that from your code.
UPDATE
Also read comments from TLama as it seems that with version 5.0.0. this fix may not operate as intended. With the current version it does though.