Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Setting "SelectionState" on a checkbox column in a TGrid
Thu, Dec 15 2016 9:51 AMPermanent Link

Richard Mace

Hi,

Could someone let me know how I can set the "SelectionState" of a checkbox column within a TGrid please?

Thanks

Richard
Thu, Dec 15 2016 10:50 AMPermanent Link

Walter Matte

Tactical Business Corporation

If it is a bounded grid - set the dataset.columns['checjfield'].Asboolean := true;

If it is an unbound grid - set 'True' or 'False':

// Append Row - first Column is a CheckBox
// Check It

procedure TForm1.Button1Click(Sender: TObject);
begin
 Grid1.AppendRow;
 Grid1.Rows[0][0] := 'True';
end;

// Toggle Checkbox

procedure TForm1.Button2Click(Sender: TObject);
begin
if   Grid1.Rows[0][0] = 'True' then
 Grid1.Rows[0][0] := 'False'
else
 Grid1.Rows[0][0] := 'True';
end;
Thu, Dec 15 2016 10:58 AMPermanent Link

Richard Mace

Walter Matte wrote:

<< If it is a bounded grid - set the dataset.columns['checjfield'].Asboolean := true;

<< If it is an unbound grid - set 'True' or 'False':

Perfect. Thanks Walter.

Richard
Image