If you are trying to point out there are less than 5 columns,
Try to itterate through the rows and cells of the datagridview,
foreach (DataGridViewRow r in dataGridView1.Rows)
{
if (r.Cells.Count <= 5)
{
foreach (DataGridViewCell c in r.Cells)
{
if (c.OwningColumn.HeaderText == "The text of the header")
{
c.OwningColumn.DefaultCellStyle.BackColor = Color.Red;
}
}
}
}