if SMDBGrid_Contact.SelectedRows.Count = 0 then begin
Application.MessageBox('There are NO rows/records selected.', 'Info', MB_OK+MB_ICONASTERISK+MB_DEFBUTTON1+MB_APPLMODAL);
end;
if SMDBGrid_Contact.SelectedRows.Count > 0 then begin
with SMDBGrid_Contact.DataSource.DataSet do begin
for i := 0 to SMDBGrid_Contact.SelectedRows.Count-1 do begin
GotoBookmark(Pointer(SMDBGrid_Contact.SelectedRows.Items
));
// Here you can excecute you're code)
end;
SMDBGrid_Contact.SelectedRows.clear;
dmTable_Contact.refresh;
end;
end;