473,323 Members | 1,574 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,323 software developers and data experts.

DataGridView HeaderCell

I can't seem to set the color of a DataGridView HeaderCell. I'm executing
the following code in the WinForm's Load event:
DataGridView1.Columns.Add("test1", "test1")
DataGridView1.Columns(0).HeaderCell.Style.ForeColo r = Color.IndianRed
The code does indeed set the property, and I can check the property in the
debugger, but the color of the text doesn't change.

Yet, I have done this previously, and it has worked. I'm at a loss to
explain it. Anyone else having the same problem?

Thanks,
Tom Costanza
Mar 23 '07 #1
1 1975
If you don't get any answers here, you might want to post to
microsoft.public.dotnet.framework.windowsforms or
microsoft.public.dotnet.languages.csharp or
microsoft.public.dotnet.languages.vb (whichever is your language of
choice). There's a guy named Clay who seems like a DataGridView fiend, but
I don't know if he checks this newsgroup.

Robin S.
---------------------------------------------
"Tom Costanza" <To*********@discussions.microsoft.comwrote in message
news:41**********************************@microsof t.com...
>I can't seem to set the color of a DataGridView HeaderCell. I'm executing
the following code in the WinForm's Load event:
DataGridView1.Columns.Add("test1", "test1")
DataGridView1.Columns(0).HeaderCell.Style.ForeColo r =
Color.IndianRed
The code does indeed set the property, and I can check the property in
the
debugger, but the color of the text doesn't change.

Yet, I have done this previously, and it has worked. I'm at a loss to
explain it. Anyone else having the same problem?

Thanks,
Tom Costanza

Mar 23 '07 #2

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

Similar topics

7
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's...
4
by: Samuel Shulman | last post by:
Hi For numeric columns I want to align it to the right How can I do that? Samuel
2
by: tee | last post by:
Hi, How do i sort datagridview programmically, current i have the following code but i keep get the error saying "DataGridView control must be bound to an IBindingList object to be sorted.", ...
3
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: I'm creating a control derived from DataGridView. I'd like the user to click a row and have the row highlight in yellow. I'd then like the user to click a column and have...
1
by: TG | last post by:
Hi! I have an application in which I have some checkboxes and depending which ones are checked those columns will show in the datagridview from sql server or no. After that I have 2 buttons:...
2
by: Steve | last post by:
Hi All I am using VB.net 2005 windows forms I use the Datagridview.cellformatting event to change the colours of individual cells as required and all works fine How can I do the same for...
1
by: =?Utf-8?B?VGFtbXk=?= | last post by:
Hi! I am using VB 2008 with SQL Server 2000 and SQL Server 2005 (depending which server the user selects to connect to). I have a combox in which the user types the server to connect to. ...
1
by: =?Utf-8?B?QWxleCBLLg==?= | last post by:
Hi all No matter how hard I try, I cannot force my DataGridView to use specific font in column headers: it seems to be always the same as container's font (which is form in my case). I set...
3
by: Andrus | last post by:
I have DataGridView in virtual mode containing 3500 rows. In code below, assigning to RowCount value to 3500 takes 8 seconds. CPU usage goes high at this time. Stepping by F11 into user code shows...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.