2010. december 11., szombat

Make a single cell in a TStringGrid readonly


Problem/Question/Abstract:

How to make a single cell in a TStringGrid readonly

Answer:

You can use OnSetEditText event for that. Something like:

procedure TForm1.StringGrid1SetEditText(Sender: TObject; ACol, ARow: Integer; const
  Value: string);
begin
  if (ACol = 1) and (ARow = 1) then
    StringGrid1.Cells[ACol, ARow] := 'Read Only!';
end;

Nincsenek megjegyzések:

Megjegyzés küldése