473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
Dec 30 '05 #1
4 11072
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.

Jan 3 '06 #2
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

Jeffrey Tan[MSFT] wrote:
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.

Jan 3 '06 #3
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/produc...k/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.

Jan 4 '06 #4
Has there been any resolution to this bug?
Apr 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: Webgour | last post by:
Hi, I'm tring to add a column to a datagrid with a linkbutton as header that can be used to sort the column. The column and the linkbutton are added programmatically (see below). However the...
2
by: David Veeneman | last post by:
How can I set a bound DataGridView control to use a dataset table's column captions, instead of column names? I'm working with a DataGridView control, which I have bound to a table in a dataset....
0
by: cedoucette | last post by:
I just wrote code to support sortable columns in a datagrid. It seems to work fine; but, it doesn't look right. The problem is that I have a generic style for links and a different style for the...
2
by: ricky | last post by:
Hello, If anyone could help me with this I would highly appreciate it. I've tried everything and nothing works. What I am trying to do is so damn basic and it's just frustrating that it seems...
10
by: rob | last post by:
I have a class that among others exposes a string property "Date". The date in this property is stored in the form yyyymmdd. Now I do the following 1) Generate a DataGridViewTextBoxColumn column...
4
by: Matt | last post by:
I have been searching all over the web for a way to sort a DataGridView based on the actual text being shown in a ComboBox column as opposed to the underlying value (an ID in this case). Can anyone...
1
by: PawelR | last post by:
Hi Group, In my application I have DataTable which is displayed in DataGridView via DataView: DataView myView = new DataView(myTable); myDataGridView.DataSource = myView; One column im...
0
by: palash909 | last post by:
Visual basic version(2008) How can i change the listview column header color and font size?? 1. Listview1 body font color is black 2.Font size 9 and style is regular ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.