I would rewrite your code as the following:
Dim myCellStyle As New iGCellStyle
myCellStyle.ForeColor = Color.White
myCellStyle.BackColor = Color.Black
For Each loopRow As iGRow In iGridSample.SelectedRows
loopRow.CellStyle = myCellStyle
Next
iGridSample.PerformAction(iGActions.DeselectAllRows)
Noe that there is no strong need to check whether we have selected rows. If the selected row count equals zero, the loop body won't be executed, and the PerformAction call will do nothing.
***
One more hint for code blocks like this, when you do bulk update of many cells. To speed up the process and avoid any flickering on the screen, call the BeginUpdate method before you execute this code and EndUpdate after that.