ListViewItem checkbox disable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Praveen Raj V
    New Member
    • Sep 2010
    • 11

    ListViewItem checkbox disable

    Is it possible to disable the checkbox of the particular ListViewItem?
    I found code to check and uncheck the ListViewItem.
    Code:
    ListViewItem lvi = new ListViewItem("One");
    lvi.Checked = false;
    but give me the solution for
    Code:
    lvi.Enable = false;
    why does the Enable Property for ListViewItem does not exist?
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    I did some googling around and it seems there are ways, but it depends on what you're looking for. I don't see a way to disable it in the "normal" sense of the word, in that it's still on the list but greyed out. However, you can remove (hide) it from the list and prevent clicking on it as well.

    Anything more than that and you may need to override the paint event on the list view and draw it yourself, which could be tricky.

    Another option might be to use a flowlayoutpanel and use individual checkboxes inside it instead of using a listview.

    There might be a way, but I'm afraid I don't know it and those are the alternatives I can think of :) Perhaps someone else will have a better idea.

    Comment

    Working...