By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,574 Members | 1,201 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,574 IT Pros & Developers. It's quick & easy.

ListViewItem checkbox disable

P: 11
Is it possible to disable the checkbox of the particular ListViewItem?
I found code to check and uncheck the ListViewItem.
Expand|Select|Wrap|Line Numbers
  1. ListViewItem lvi = new ListViewItem("One");
  2. lvi.Checked = false;
but give me the solution for
Expand|Select|Wrap|Line Numbers
  1. lvi.Enable = false;
why does the Enable Property for ListViewItem does not exist?
Oct 21 '10 #1
Share this Question
Share on Google+
1 Reply


GaryTexmo
Expert 100+
P: 1,501
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.
Oct 21 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.