Try
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
int colIndex = e.ColumnIndex;
int rowIndex = e.RowIndex;
if (rowIndex >= 0 && colIndex >= 0)
{
DataGridViewRow theRow = dataGridView1.Rows[rowIndex];
if (theRow.Cells[colIndex].Value.ToString().StartsWith("S"))
theRow.DefaultCellStyle.BackColor = Color.Red;
}
}