Disable Checkbox in ListView

P

Pascal Berger

Is there a way to disable the checkbox of a certain ListViewItem in a
ListView?

Thanks in advance
Pascal
 
D

Daniel Moth

There might be but I don't know it.

The workaround that works is to catch the ItemCheck event and based on the
e.Index decide what you are going to assign to e.NewValue

Cheers
Daniel
 
P

Pascal Berger

Daniel said:
The workaround that works is to catch the ItemCheck event and based on the
e.Index decide what you are going to assign to e.NewValue
This might be a solution. But I think it's quiet confusing for the user
if he clicks on an item and the checkbox isn't checked, as long as the
checkbox isn't grayed out.
Is there's a way to gray out the checkbox? I haven't found any event for
custom drawing.

Thanks
Pascal
 
D

Daniel Moth

Well you could, in addition to assigning e.NewValue, put up a messagebox or
otherwise inform the user of why they cannot change it...

Again, I know of no way to greying out the checkbox of a certain
listivewitem of the CF ListView.

Cheers
Daniel
 
C

Chris Tacke, eMVP

Unfortunately it's not an option. Go with a ListView with custom icons and
you can simulate the behavior.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top