Dev Center > Windows Forms Forums > Windows Forms Data Controls and Databinding > DataGridView Column Header Cell Style not working

Answered DataGridView Column Header Cell Style not working

  • Saturday, August 12, 2006 9:25 AM
     
     

    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 

Answers

All Replies

  • Saturday, August 12, 2006 11:31 PM
     
     Answered

    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

  • Tuesday, August 15, 2006 11:41 AM
     
     
    Thank you very much. I understand now what I need to do
  • Wednesday, August 30, 2006 7:10 PM
     
     
    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?
  • Wednesday, August 30, 2006 11:55 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"

     

  • Wednesday, August 12, 2009 12:44 PM
     
     Proposed Answer
    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 by Deepak Anmol Wednesday, August 12, 2009 12:44 PM
    •