Which rows have been selected in a TDBGrid

Question:

In a MultiSelect DBGrid, how can I determine which rows have been selected?

Answer:

Use the SelectedRows property of the TDBGrid component.

Example:

for i=0 to DBGrid1->SelectedRows->Count -1 do

 Table1.GotoBookmark(TBookMark(DBGrid1.SelectedRows.Items[i]));