Hello everybody,
In WinForms, the DataGridView control has RowHeadersDefaultCellStyle. I get it with MiddleCentre alignment. Nice.
At execution I get all headers aligned on the left.
In Northwind database, the product table has a product Id. It is a number, the data is aligned right.
It has a product name : the data is aligned left.
Then we have three ids, they are aligned on the right.
Then we have a quantity per unit. It appears that, at least in English, this appears more readable when centered.
Then we have four columns aligned on the right, and one with just a checkbox.
Except when specified otherwise, I think it is best that the headers are aligned as the data they represent.
How do you achieve that with DataGridView ?
I could declare a format for each header cell, and then put them in a table, but then I search a property of the DataGridView to receive it ...
With other controls I remember having a header style in the properties of the column, but there I do not find it.
Also considering the formats of the headers ... I have set a large font for the data to be able to read it, but as the headers are much longer and only need to be read once, and the tips can help, a more little font could be appropriate for some of them, particularly the ids. I presume that if we can align the headers as needed then we can also display them with the good font.
In WinForms, the DataGridView control has RowHeadersDefaultCellStyle. I get it with MiddleCentre alignment. Nice.
At execution I get all headers aligned on the left.
In Northwind database, the product table has a product Id. It is a number, the data is aligned right.
It has a product name : the data is aligned left.
Then we have three ids, they are aligned on the right.
Then we have a quantity per unit. It appears that, at least in English, this appears more readable when centered.
Then we have four columns aligned on the right, and one with just a checkbox.
Except when specified otherwise, I think it is best that the headers are aligned as the data they represent.
How do you achieve that with DataGridView ?
I could declare a format for each header cell, and then put them in a table, but then I search a property of the DataGridView to receive it ...
With other controls I remember having a header style in the properties of the column, but there I do not find it.
Also considering the formats of the headers ... I have set a large font for the data to be able to read it, but as the headers are much longer and only need to be read once, and the tips can help, a more little font could be appropriate for some of them, particularly the ids. I presume that if we can align the headers as needed then we can also display them with the good font.