That is because you are removing rows from the beginning to the end. This will cause problems because the next row won’t be the next row upon next iteration of the loop because you are removing a row, and all other rows will be reordered. The way to stop this is going from the last to the first.
You need to do something like:
for(int i = gridContro1.SelectedRows.Count; i > 0; i–)
if(gridControl1.SelectedRows(i) is DataRow)
Imported from legacy forums. Posted by hellswraith (had 4621 views)