Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Jeddah, Saudi Arabia
    Posts
    243
    Thanks
    0
    Thanked 1 Time in 1 Post

    ListView Sort Indicators (VB .NET 2003)

    I have a program that uses ListView controls on various forms. I have code that allows the user to sort the columns in the ListView by clicking on the column heading. That works fine. BUT, (Isn't there always a BUT?) I want to add the little down/up arrows like you see in Explorer and other programs to the column titles to indicate the sort direction and for the life of me I can't find out how to do it.

    Any help would be gratefully accepted.

    Regards,
    Kevin Bell

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: ListView Sort Indicators (VB .NET 2003)

    Hi Kevin,
    Take a look at this page. It's in C# but appears to give you the ability to add images from an imagelist to column headers in a ListView.
    HTH.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Jeddah, Saudi Arabia
    Posts
    243
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ListView Sort Indicators (VB .NET 2003)

    Thanks Rory. I'll put my C# hat on for a while or maybe I'll try and convert the C# code to good old VB.

    You would think something as simple as this would exist as a property of the HeaderControl class eh? I think I'll add a ShowTheLittleArrows property myself.

    Cheers,
    Kevin Bell

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ListView Sort Indicators (VB .NET 2003)

    If you use a grid instead, the arrows will be their by default but you'll have to set the ReadOnly property to true and, of course, it won't *look* like a listview. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •