Changing DataGridView Header Cells' Text Alignment And The Font Size
You can use the ColumnHeadersDefaultCellStyle.Alignment
with MiddleCenter
as its value. Check the code below:
dataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
or just try this:
dgvBreakDowns.Columns[4].HeaderCell.Style.Alignment = DataGridViewContentAlignment.BottomCenter;
Try this (note I'm using Columns here and not Rows):
foreach(DataGridViewColumn col in dgvBreakDowns.Columns)
{
col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
col.HeaderCell.Style.Font = new Font("Arial", 12F, FontStyle.Bold, GraphicsUnit.Pixel);
}
As for deselecting the cell, try dgvBreakDowns.ClearSelection()