VB2005 - Cannot Change Column Header Font on DataGridView if DefaultFont is set on Form

M

Matt

Another interesting issue:
I set the default font on most of my forms to what I want the text in my
controls to show up as (say, Verdana 9pt.), and then just change the
font on labels and buttons when I lay them out (to Verdana 9pt. Bold,
for example). This works for every control I have seen except the column
headers on DataGridView controls. When I am in design mode, I am able to
change the font under the ColumnHeaderDefaultCellStyle property, and the
form reflects the change and allows me to save. However, if I close and
re-open the form in design mode, I can see that it has set the font back
to whatever the default was for the form. It leaves all of the other
changes I made under ColumnHeaderDefaultCellStyle alone (e.g.,
ForeColor, BackColor). Is there any way to work around this issue
(preferably without setting it programmatically on the load event)?

Thanks,
Matt
 
J

Jeffrey Tan[MSFT]

Hi Matt,

Thanks for your post.

Based on my understanding, every time you changed the font on the column
header, it will reverse back to its old default value after closing and
re-open.

On my machine, I tried to create a VS2005 project, then bind DataGridView
to certain datasource. Then after changing the ColumnHeaderDefaultCellStyle
font to bold, I close/save the form designer and all child windows. Then
after reopening the form designer, it will still show the bold font without
reversing to non-bold font.

It seems that I can not reproduce your problem on my side. Can you provide
some more information to help us reproduce your problem? Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
M

Matt

Jeffrey,
Thanks for your response here, and I'm sorry I didn't make the issue
clearer. The problem only arises when I set the default font on the form
(set via the form's property box) to something other than the standard
(Microsoft Sans Serif, 8.25pt). If it is set to the default font, all of
my changes to the fonts in the headers work fine, but if I set the
form's default font to something other than MSS 8.25pt, the column
headers always revert back to that font on the re-opening of the form.
Try setting the default form font to Verdana 9pt and the Column Header
font to Verdana, 9pt Bold if you want to replicate my issue exactly.

Regards,
Matt
 
J

Jeffrey Tan[MSFT]

Hi Matt ,

Thanks for your feedback.

Yes, after changing the form's default font style, I can reproduce out your
problem. This problem also existed in VC#2005 IDE. And although the
original font style will lose after saving, we still can see the correct
font code in Form1.Designer.cs file. At runtime, the applicaiton also can
not recognize this saving code. It seems that this is a bug. However, I did
not find any reported bug regarding this issue in our internal database. So
I suggest you submit this issue to our product team at the link below:
http://lab.msdn.microsoft.com/productfeedback/default.aspx

Our product team will follow up with your bug request.

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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