views:

515

answers:

2

I'm trying to create a WinForms ListView control with 6 columns. The first two columns will have text in them, but I want the last for columns to have a checkbox in them.

I know how to add a ListViewSubItem with text (did this for the second column), but how do you insert a CheckBox?

A: 

When you define the columns for the ListView, you have to change the type to checkbox

Grzenio
+2  A: 

ListView doesn't support this. Only the 1st column can have a checkbox. You could fake it with custom drawing and mouse hit testing but that's a lot of work. Consider using a DataGridView instead. You can change the column type to DataGridViewCheckBoxColumn.

Hans Passant
Awesome...that was exactly what I was looking for. Didn't even think to look for another control other than listbox. Thanks!
Adam Haile