473,609 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ColumnHeaderDef aultCellStyle 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 ColumnHeaderDef aultCellStyle alone (e.g.,
ForeColor, BackColor). Is there any way to work around this issue
(preferably without setting it programmaticall y on the load event)?

Thanks,
Matt
Dec 30 '05 #1
4 11095
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 ColumnHeaderDef aultCellStyle
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 ColumnHeaderDef aultCellStyle
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
jasonbogen
1 New Member
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
5461
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 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
1
8902
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 problem is that when you click the added column header it doesn't trigger the sort. The code : <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false"
2
9662
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. The dataset is created at run time, so I don't know column headers in advance. The table's column captions are set at run time, using the DataColumn.Caption property. The table is bound to the grid using the grid's DataSource property. Here is my...
0
2616
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 header row - and they conflict. The sortable column apparently uses the generic style for <a> elements and the rest of the header uses "headerRow". Can anyone tell me how to get consistent styles for each column in my datagrid header?
2
3936
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 there's no support for this. Either that or I'm doing something wrong. Well, enough venting, here's what I need. Using this sample XML file (test.xml):
10
26981
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 for that property 2) Add the column to the datagridview 3) Populate a BindingSource by adding all instances of the above mentioned class. 4) Assign the BindingSource to the datagridview's DataSource property
4
8626
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 tell me if this is even possible, and if so, how to do it? If this is completely impossible, how would you suggest going about sorting a ComboBox wherein the text displayed in the column is the client's name, and the underlying value is an ID? ...
1
4111
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 myTable is boolean (two state - without null value). How can I change value in this column after click on row in datagridview (one of cells in rows).
0
3073
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 ---------------------------------------Column Header---------------------------------------
0
8127
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8067
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8567
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8398
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2529
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.