How Do I Change Grid HeaderText Fontsize?

S

Steven C

Hello.

I have a datagrid with a datagridtablestyle and several
datagridtextboxcolumns. I have overridden the Paint method on the
datagridtextboxcolumns via a class called
"customdatagridtextboxcolumn," but can't figure out how to set a custom
font size for the column headers on the displayed windows form grid.
Can anyone help?

Thanks!
Steven
 
A

Alan Pretre

Steven C said:
can't figure out how to set a custom
font size for the column headers on the displayed windows form grid.


Put something like this in your form constructor.

MyGrid.TableStyles[0].HeaderFont = new System.Drawing.Font("Microsoft San
Serif", 8.25f, System.Drawing.FontStyle.Bold);

-- Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top