Hallo.
Ich würde es über das Ereignis OnDrawCell lösen:
Delphi-Quellcode:
procedure TDemoForm.MasterGridDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
var
sPos: String;
begin
with Sender as TStringGrid do
begin
sPos := IntToStr(Succ(ARow - FixedRows));
if (ACol = 0)
and (ARow >= FixedRows)
and (Cells[ACol, ARow] <> sPos) then
Cells[ACol, ARow] := IfThen(RowCount = Succ(MasterCount), sPos, '');
end;
end;
Grüße vom marabu