[ DeYo @ 25.02.2005. 19:58 ] @
Dakle,
imam DBGrid, ADOQuery, ADODataSet
u DBGrid-u sam omogucio MultipleSelect, iskljucio ConfirmDelete i CancelOnExit

Pitanje: kako da obrisem sve selektovane redove iz DBGrid-a?
Svejedno mi je kako, da li ADOQuery-jem, direktno iz DBGrid-a...

Ima li neko resenje? Ja se ubih trazeci po netu i nista. A prob'o sam i sam da resim - i opet nista.
[ _v!rus_ @ 26.02.2005. 05:44 ] @
Varijanta 1
Code:

DBGrid1.SelectedRows.Delete;

Varijanta 2
Code:

var
  I: Integer;
begin
  if DBGrid1.SelectedRows.Count>0 then
    with DBGrid1.DataSource.DataSet do
      for I := 0 to DBGrid1.SelectedRows.Count - 1 do
      begin
        GotoBookmark(pointer(DBGrid1.SelectedRows.Items[I]));
        Delete;
      end;
end;

[ DeYo @ 02.03.2005. 16:37 ] @
To je to.

Fala.