OnSelectCell (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following code ensures that you cannot select a cell unless it is empty.

Code

procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol, ARow: Longint; var CanSelect: Boolean);
begin
  CanSelect := (StringGrid1.Cells[ACol, ARow]='')
end;

Uses