0

Start a new Forms application.
Add a DataGridView control to the Form.
Add a few Columns to the DataGridView.
In the properties window select the ColumnHeadersDefaultCellStyle (ahh what's in a name...) property.
A dialog opens. Change the appearance BackColor to whatever color you like.
Run the application. On my system I never get the chosen color for the column headers.
Anyone any ideas?

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by ddanbe
Featured Replies
  • 1

    Check for this (msdn): [QUOTE]If visual styles are enabled and EnableHeadersVisualStyles is set to true, all header cells except the TopLeftHeaderCell are painted using the current theme and the ColumnHeadersDefaultCellStyle values are ignored.[/QUOTE] I've tried to set the [B] EnableHeadersVisualStyles [/B] to [B]false[/B] and it's working. Read More

1

Check for this (msdn):

If visual styles are enabled and EnableHeadersVisualStyles is set to true, all header cells except the TopLeftHeaderCell are painted using the current theme and the ColumnHeadersDefaultCellStyle values are ignored.

I've tried to set the EnableHeadersVisualStyles to false and it's working.

Votes + Comments
Nice.
0

I've tried to set the EnableHeadersVisualStyles to false and it's working.

I didn't change any property and it's working without any problem!!
+ EnableHeadersVisualStyles = true and it's also working...

0

He Antenka thanks! It's working!
Ramy I don't know why it is working with you in both ways, but consider this solved.
Thanks again.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.