Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DataGridView Column Header Cell Style not working
 

DataGridView Column Header Cell Style not working

The backcolor for row header and column header does not work.

e.g.

Grid.Column(0).HeaderCell.Style.BackColor=Color.Blue

Grid.Rows(0).HeaderCell.Style.BackColor=Color.Blue

Grid.TopLeftHeaderCell.Style.BackColor=Color.Blue

Stephen Chiu  Saturday, August 12, 2006 9:25 AM

Sorry you will have to draw the column or row headers yourself if you want to change the color.

Paint in Column Header or Paint in Row header

Ken Tucker  Saturday, August 12, 2006 11:31 PM

Sorry you will have to draw the column or row headers yourself if you want to change the color.

Paint in Column Header or Paint in Row header

Ken Tucker  Saturday, August 12, 2006 11:31 PM
Thank you very much. I understand now what I need to do
Stephen Chiu  Tuesday, August 15, 2006 11:41 AM
If we do so, then column sorting feature gets lost. The sorting arrow at corner of column header dissappears, thats because whole rectangle gets filled. How to retain it?
Rajat_Katyal  Wednesday, August 30, 2006 7:10 PM

You could always just remove the theming on the headers. Set EnableHeadersVisualStyles to false and the header coloring will be honored.

-mark
Program Manager
Microsoft
This post is provided "as-is"

Mark Rideout  Wednesday, August 30, 2006 11:55 PM
Wawwwww, it will solve my prob.. Great Job man...


You could always just remove the theming on the headers. Set EnableHeadersVisualStyles to false and the header coloring will be honored.

-- With Regards Deepak Anmol Sr Developer MCTS, MCP
  • Proposed As Answer byDeepak Anmol Wednesday, August 12, 2009 12:44 PM
  •  
Deepak Anmol  Wednesday, August 12, 2009 12:44 PM

You can use google to search for other answers

Custom Search

More Threads

• datagridview sum
• ERROR: Cannot create a child list for field Table
• datagridview textcolumn wrap
• Font problems with DataGridView component?
• How to bind Rectangle properties to a data source
• DataGridView - BeginUpdate
• Could not bind to the new display member.\r\nParameter name: newDisplayMember
• Strongly-typed DataColumn change events
• DataGrid Displaying two Tables
• Making DataGridview Virtual Mode caching sample faster