I’d like the column header to show a unicode string.
I can do this:
dataGridView1.Columns[10].HeaderText = "\u2191"; // uparrow
…But it displays as a square box, not an up arrow as I intended.
How can I do what I want?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is necessary to set the font for the control to be a unicode-aware font, a font that can properly display the unicode characters in question.
The default font for Windows Forms (on my machine anyway) is “Microsoft Sans Serif” , which apparently displays unicode characters as a square box.
A font that allows unicode on my machine is “Lucida Sans Unicode” but there are others.
I could set the font for the entire datagridview in the designer.
If setting the font for the entire datagridview is for some reason undesirable, it is possible to set the font for the header cell of any particular column. I don’t believe this is possible in the VS designer, but it is possible in code. The font is attached to the
Styleproperty, so the code looks like this: