DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C# (http://www.daniweb.com/forums/forum61.html)
-   -   DataGridView property not working as expected (http://www.daniweb.com/forums/thread171624.html)

ddanbe Jan 27th, 2009 3:12 pm
DataGridView property not working as expected
 
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?

Ramy Mahrous Jan 27th, 2009 3:26 pm
Re: DataGridView property not working as expected
 
Strange :| It works with me...

Antenka Jan 27th, 2009 3:36 pm
Re: DataGridView property not working as expected
 
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.
I've tried to set the EnableHeadersVisualStyles to false and it's working.

Ramy Mahrous Jan 27th, 2009 3:40 pm
Re: DataGridView property not working as expected
 
Quote:

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...

ddanbe Jan 27th, 2009 3:49 pm
Re: DataGridView property not working as expected
 
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.


All times are GMT -4. The time now is 6:10 am.

Forum system based on vBulletin Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
©2003 - 2010 DaniWeb® LLC