Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Library: VCL / WinForms / Controls (https://www.delphipraxis.net/24-library-vcl-winforms-controls/)
-   -   Delphi Zeile aus StringGrid löschen (https://www.delphipraxis.net/69074-zeile-aus-stringgrid-loeschen.html)

CalganX 9. Mai 2006 21:53


Zeile aus StringGrid löschen
 
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:
Delphi-Quellcode:
DeleteRow(StringGrid1, StringGrid1.Row);


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:25 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz