Check Box in list view header

molemenacer

Active member
Joined
Jul 27, 2006
Messages
27
Location
Haywards Heath, UK
Programming Experience
Beginner
Hi all,

I have a list view, with the first column being checkboxes.

My question is whether you can have a checkbox in the column header and be able to use that to select all the checkboxes in the list view.

At the moment a have a checkbox on top of the list view and that seems to work but i was wondering if it is possible to have a check box in the listview.

Any help appreciated.
 
You're doing it the right way now with a Checkbox control on top. There is no option for this in the Listview control.
 
The answer is yes, but you would need to write a custom control for it. The easiest work around I have done is I add 2 link labels right above the column saying check / Uncheck. Then just have it itterate through for the appropriate option and either check or uncheck. I would strongly recommend not using a listview if you are using a windows application. Unless you need the large Icons for some reason, you can replicate the functionality with ease in a datagrid and have much more control.
 
Back
Top