Please give me a Sourcecode for Delete all selected Rows of a Grid.
Thanks Frank
FRoe...@LDT-Gera.de
Deleting selected records:
----------------------------------------
........Grid.SelectedRows.Delete
Iterating all selected records:
----------------------------------------
For i := 0 to Grid.SelectedRows.Count -1 do begin
{ GoTo selected record: }
Grid.datasource.dataset.Bookmark := Grid.SelectedRows.Items[i];
{ Do something with i-th selected record }
..................
end;
--
Roman
(please remove 'stopspam' in header when replying)
mail: in...@rksolution.cz
URL: www.rksolution.cz
Bill
--
Bill Todd - TeamB
(TeamB cannot respond to email questions. To contact me
for any other reason remove nospam from my address.)
Thanks Bill !
I had full success. But I have your sourcecode changed minimal.
The Counter must go down. If you delete a Record, the other Records will
glides up.
So the other Bookmarks show to the wrong Records.
for i:=DBGrid1.SelectedRows.Count-1 downto 0 do
begin
Table1.GoToBookmark(TBookmark(DBGrid1.SelectedRows[i]));
Table1.delete;
end;
DBGrid1.SelectedRows.Clear;