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

  • SEARCH
  • Home
  • 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 8311675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:53:43+00:00 2026-06-08T19:53:43+00:00

When clicking on a ListView’s Group Header in XP, nothing happens. When clicking on

  • 0

When clicking on a ListView’s Group Header in XP, nothing happens.
When clicking on a ListView’s Group Header in Windows 7, all items in this group are selected.
I cannot test on Windows Vista as I do not have a machine.

How can one disable the “Select All” by clicking on the Group Header introduced in Windows 7 (or maybe Vista).

The user should still be allowed to select multiple or even all the items if they wish, just not via clicking the Group Header.

Answers which don’t suggest using alternative ListViews (e.g. ObjectListView) would be appreciated!

I am not using WPF.

Update

I tried, as a test, in the mouse-up event of the ListView adding a hit test to see if the group-header was being clicked and if it is to deselect all items.

When running in XP, this performs the desired effect. In Windows 7, it still selects all the items in that group!

Update 2

Solution found: see my answer.

  • 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-06-08T19:53:45+00:00Added an answer on June 8, 2026 at 7:53 pm

    I’ve figured it out.

    Hopefully somebody will find this useful –

    In this thread on MSDN, somebody was trying to create an event for clicking on a group header. I have re-appropriated this for my purposes as follows (see link for how functions and constants are defined):

    public class MyListView : ListView
    {
        //
        //some other code here, i.e. define constants, PInvoke, etc (see link)
        //
    
        protected override void WndProc(ref Message m)
        {
            //the link uses WM_LBUTTONDOWN but I found that it doesn't work
            if (m.Msg == WM_LBUTTONUP) 
            {
                LVHITTESTINFO info = new LVHITTESTINFO();
    
                //The LParamToPOINT function I adapted to not bother with 
                //  converting to System.Drawing.Point, rather I just made 
                //  its return type the POINT struct
                info.pt = LParamToPOINT(m.LParam);
    
                //if the click is on the group header, exit, otherwise send message
                if (SendMessage(this.Handle, LVM_SUBITEMHITTEST, -1, ref info) != -1)
                    if ((info.flags & LVHITTESTFLAGS.LVHT_EX_GROUP_HEADER) != 0)
                        return; //*
            }
            base.WndProc(ref m);
        }
    }
    

    This allows clicks to be recognised unless one clicks on the Group Header. If you want to perform some extra functionality, at //* you could place an event, etc.

    Use a switch on m.Msg instead of using if if you require more WndProc functionality.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Windows' file explorer, you can sort ListViews by clicking on the column header
I have some kind ListView. All items in it are in rectangle shape, but
In my program after clicking on the button - selected ListView entries should be
I made a custom listview following the tutorial in this link http://www.coderzheaven.com/2012/03/23/how-to-create-a-custom-listbox-in-windows-phone-7/ and My
I'm using a PopupWindow to show some subcategories when clicking on a ListView item.
I have to update a ListView item by clicking on a button. How do
I have fetched images and text as listview from database.now on clicking the particular
I'm passing data to a ListView to display some restaurant names. Now when clicking
How do I apply clicking action on listview in android?
The Code below displays a dialog after clicking on a ListView's Item.I would instead

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.