Mick
Mick

Reputation: 13495

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?

Upvotes: 4

Views: 2728

Answers (2)

Warren  P
Warren P

Reputation: 69102

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

Upvotes: 2

Roman Yankovsky
Roman Yankovsky

Reputation: 1217

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

Upvotes: 9

Related Questions