I have a column Name “Quote Price” in a DataGridView winforms control. I can right align a column with no spaces such as “Unit” howerver I can’t right align the column header with column Name called “Quote Price”. I have attempted to use the TopRight, MiddleRight and bottomRight with no success.
SelectedAdditionalCost.Columns["Quote Price"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight; // Doesn't want to right align SelectedAdditionalCost.Columns["Quote Price"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; // column contents No worries, right aligns.
I am sure I am doing something really silly, however, I can’t get this working.