Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I setup TListView with CheckBoxes in only certain columns?

I'm using Delphi 2010, and I am trying to allow the user to select between 2 options per row in a TListView. With TListView, I can set the style to vsReport and enable Checkboxes, but that only gets me 1 checkbox per row. What I need is 2 checkboxes per row...specifically 1 for the 1st column and 1 for the 2nd column.

What I am trying to accomplish is very similar to the standard Windows file security dialog: enter image description here

Does anyone have any suggestions for implementing something like this using TListView or even MustangPeak's TEasyListView?

like image 613
Mick Avatar asked Dec 21 '22 16:12

Mick


2 Answers

Take a look at this Put a TCheckBox inside a TStringGrid in Delphi

update The link shows how to draw checkboxes. You can do the same using TListView.OnCustomDrawItem and/or OnCustomDrawSubItem events

like image 76
Roman Yankovsky Avatar answered Mar 22 '23 23:03

Roman Yankovsky


I use my own modified version of ExGridView by Roman Mochalov, and full sources for my modified version, plus a demo here (open the Demo in the Demo2 folder) showing checkboxes.

enter image description here

like image 37
Warren P Avatar answered Mar 22 '23 23:03

Warren P