title: Changing DataGridView Header Cells' Text Alignment And The Font Size
body: <p>I'm trying to change the text alignment and the font size of a DataGridView. All the Columns are created programatically at runtime. Here's the code..</p>
  
  <pre><code>private void LoadData()
  {
      dgvBreakDowns.ColumnCount = 5;
      dgvBreakDowns.Columns[0].Name = "Breakdown No";
      dgvBreakDowns.Columns[1].Name = "Breakdown Type";
      dgvBreakDowns.Columns[2].Name = "Machine Type";
      dgvBreakDowns.Columns[3].Name = "Date";
      dgvBreakDowns.Columns[4].Name = "Completed";
  
      dgvBreakDowns.Columns[4].Visible = false;
  
      foreach (DataGridViewHeaderCell header in dgvBreakDowns.Rows)
      {
          header.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
          header.Style.Font = new Font("Arial", 12F, FontStyle.Bold, GraphicsUnit.Pixel);
      }
  }
  </code></pre>
  
  <p>This <code>LoadData()</code> method is called in the Form's constructor. The Columns are created but their Headers' changes don't apply. 
  I think its because of a flaw in my loop <code>foreach (DataGridViewHeaderCell header in dgvBreakDowns.Rows)?</code> I'm not sure. I tried changing it to <code>dgvBreakDowns.Columns</code> and I get an InvalidCastException. How can I select the Header Cells to apply those changes?</p>
  
  <p>I have another minor issue. When I run the program it looks like this.</p>
  
  <p><img src="https://i.stack.imgur.com/x58IQ.png" alt="enter image description here"></p>
  
  <p>Notice the first Cell is selected by default therefore it appears Blue. Sure it doesn't affect anything but it just looks somewhat ugly and untidy. It is possible to stop it from selecting the Cell like that?</p>