Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6894201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:45:12+00:00 2026-05-27T06:45:12+00:00

I am using a VirtualStringTree control as a list view and using the sort

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:45:13+00:00Added an answer on May 27, 2026 at 6:45 am

    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 OnHeaderClick event (not OnHeaderDblClick !).

    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.

      {**
        A column header of a VirtualStringTree was clicked: Toggle the sort direction
      }
      procedure TMainForm.vstHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
      begin
    
      // Don't call sorting procedure on right click
      // Some list-headers have a contextmenu which should popup then.
      if HitInfo.Button = mbRight then Exit;
    
      // Beginning with VT's r181, this proc is also called when doubleclicking-to-autofit
      // Seems buggy in VT as this suddenly calls it with Column=-1 in those cases.
      // See also issue #1150
      if HitInfo.Column = NoColumn then Exit;
    
      if Sender.SortColumn <> HitInfo.Column then Sender.SortColumn := HitInfo.Column
      else if Sender.SortDirection = sdAscending then Sender.SortDirection := sdDescending
      else Sender.SortDirection := sdAscending;
    
      Sender.Treeview.SortTree( HitInfo.Column, Sender.SortDirection );
      end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using online interfaces to a version control system is a nice way to have
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
I am using Delphi2010 and trying to wrap my head around using VirtualStringTree. I've
Is it possible to export a VirtualStringTree to Excel or CSV? I am using
Using VB6 I am using checkbox and combobox in a Form. When i click
I am trying to implement a simple contact manager using the VirtualStringTree component. I
Using posh-git in powershell I am able to list all the items in the
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using ASP.NET MVC there are situations (such as form submission) that may require a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.