1. 程式人生 > >delphi 刪除行換記錄

delphi 刪除行換記錄

procedure TFormBOM.SptCraftDelClick(
  Sender: TObject);
var
  i: integer;
begin
  if not CdsCraftCode.Active then
    Exit;
  if CdsCraftCode.RecordCount = 0 then
    Exit;
  if DBGCraftCode.SelectedRows.Count = 0 then
    Exit;
  for i := DBGCraftCode.SelectedRows.Count-1 downto 0 do
    begin
      CdsCraftCode.GotoBookmark(pointer(DBGCraftCode.SelectedRows.Items[i]));
      CdsCraftCode.Delete;
    end;
end;