I belive you can do something according to:
List<int> selectedRowIndexes = new List<int>();
foreach(DataGridViewRow row in dataGrid.SelectedRows)
{
selectedRowIndexes.Add(row.Index);
}
//To save bandwith and cputime you should make one query for deleting all the rows
//instead of deleting one at a time.
... code for deleting the indexes ...
Happy coding! -Larantz- -- modified at 18:00 Friday 7th September, 2007 Fixed missing <> for the generic list.
for those about to code, we salute you
http://www.itverket.no
Please refer to the Forum Guidelines for appropriate posting.