Board index » delphi » about selected rows in DBGrids

about selected rows in DBGrids

Hi,

I have a DBGrids listing the record indexs of a dataset
DBGrids -> DBDataSet -> TQuery
I have set the Grids has row select and multiple select.
How can I process the selected items one by one in the
DataSet? Thanks in advance!

---- Brittle

 

Re:about selected rows in DBGrids


SelectedRows is a collection of bookmarks, e.g.:

for i := 0 to DBGrid1.SelectedRows.Count - 1 do
begin
  Table1.Bookmark := DBGrid1.SelectedRows[i];
  // Do something with the current record...
end;

"Brittle" <kht...@cse.cuhk.edu.hk> schreef in bericht
news:8vbavn$5i9$1@eng-ser1.erg.cuhk.edu.hk...

Quote
> Hi,

> I have a DBGrids listing the record indexs of a dataset
> DBGrids -> DBDataSet -> TQuery
> I have set the Grids has row select and multiple select.
> How can I process the selected items one by one in the
> DataSet? Thanks in advance!

> ---- Brittle

Other Threads