locked
DataGridView Column Header Cell Style not working RRS feed

  • Question

  • 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 

    Saturday, August 12, 2006 9:25 AM

Answers

All replies

  • 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

    Saturday, August 12, 2006 11:31 PM
  • Thank you very much. I understand now what I need to do
    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?
    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"

     

    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 by Deepak Anmol Wednesday, August 12, 2009 12:44 PM
    Wednesday, August 12, 2009 12:44 PM
  • Thanks, It solved my problem
    Friday, July 25, 2014 12:32 PM