disable and enable rows in CListCtrl

Posted on 2006-03-22
Last Modified: 2013-11-20
Is there a way you can disable and enable individual rows in CListCtrl.
Question by:docieb
    LVL 49

    Expert Comment

    Not directly.  You can do the ownerdraw thing to make them *look* disabled and then take action when the user tries to select one.  

    Depending on your needs, you might be able to accomplish your goal by use the checkbox style -- as a kind of stand-in for enabled/not-enabled (checked/non-checked).

    There are a number of CListCtrl-derived objects available that do that.  Try checking here
    if you are intersted in using somebody elese ownerdraw logic.
    LVL 49

    Accepted Solution

    In particular, this one (by MFC Superstar Chris Mauder) seems to allow disabling of rows:

        MFC Grid control (derived from CWnd)

    -- Dan

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    if loop error 4 66
    sumDigits challenge 9 71
    Smart Camera scanning and reading information 3 76
    sumHeights  challenge 17 50
    Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
    Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now