Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4695
set cell background color
posted

Dear all,

How to set the cell in the ultragrid background color to be same as the column header background color???

  • 469350
    Offline posted

    Hi,

    I'm not sure exactly what you are asking. You can change the color of any individual cell in the grid using the cell's Appearance property. If you want to change the color of all cells, then you would use:

    grid.DisplayLayout.CellAppearance

    The grid's column headers are themed by default - they use the operating system themes. So there is no way to actually retrieve that color directly from the objects, but depending on what theme you are using and what options you have set for the grid headers and HeaderStyle, you might be able to get the color from one of the static color tables in the Win assembly. But the colors will vary by operating system.

    If you want the colors to always match up, then the best thing to do is to turn off themes.