marabu hat
hier einen Source gepostet, um eine beliebige Zeile aus einem
TStringGrid zu löschen:
Delphi-Quellcode:
type
TGridCracker = class(TCustomGrid);
procedure DeleteRow(sg: TStringGrid; index: Integer);
var
iRow: Integer;
begin
with TGridCracker(sg) do
begin
iRow := Row;
DeleteRow(index);
if iRow < RowCount then
Row := iRow
else
Row := Pred(RowCount);
end;
end;
Anwendungsbeispiel:
DeleteRow(StringGrid1, StringGrid1.Row);