UPDATE info
{ checkbox for bookmark}
1) Select the DBGrid [Right-Click] to popup Chose "EditColumns..."
2) Popup window (Editing EBGrid.Columns[0]...) below title bar find and click the [Add] button
3) Notice in (Fetch Labels) listbox a new line appears as "0 -Tile" select that line
4) IDE (Properties [(filter) ]) window notice the "Properties" tab is selected
5) Just me but set
a. ButtonStyle | cbsCheckboxColumn
b. Title .Alignment | taCenter
..Caption | Pick
...Font . Style | [fsBold]
c.Width | 40
{NOTE: all other dbcolmuns will load as normal with the ".Open" command
or free to set your own configuration}
6) Close popup window (Editing EBGrid.Columns[0]...) and as DBGrid is selected
7) Click the "Events" tab set these events
a. OnCellClick | DBGrid1CellClick
b. OnUserCheckboxState | DBGrid2UserCheckboxState
8 ) IDE (Source Editor) window code these events
procedure TForm1.DBGrid1CellClick(Column: TColumn);
begin
if Column.Index=0 then
RecList.CurrentRowSelected := not RecList.CurrentRowSelected;
end;
procedure TForm1.DBGrid1UserCheckboxState(sender: TObject; column: TColumn; var AState: TCheckboxState);
begin
if RecList.CurrentRowSelected then
AState := cbChecked
else
AState := cbUnchecked;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
RecList := TBookmarkList.Create(DbGrid1);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
RecList.Free;
end;
suggest reading through linked literature
Special thanks goes to member [Sieben]