3

I have a ListView with checkboxes:

        listView1.View = View.Details;
        listView1.CheckBoxes = true;

        ListViewItem item1 = new ListViewItem("ONE");
        ListViewItem item2 = new ListViewItem("TWO");
        ListViewItem item3 = new ListViewItem("THREE");

        listView1.Items.Add(item1);
        listView1.Items.Add(item2);
        listView1.Items.Add(item3);

I would like to disable only the second checkbox, is it possible?

1

1 Answer 1

2

I think you can do that with owner drawing using the DrawItem event. In the event handler, draw a rectangle filled with SystemColors.Window over the check box to hide it.

I have also implemented check box hiding in 3rd party control Better ListView Express. Items have a boolean property named AllowShowCheckBox which you can set to false on every item separately. It also supports three-state check boxes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.