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
785
Column Header appareance
posted

Hi,

I am trying to customize the color of the column headers. I am able to change the background color using the following statements:

ultraGrid1.DisplayLayout.Bands[0].Override.HeaderAppearance.ThemedElementAlpha = Infragistics.Win.Alpha.Transparent;
ultraGrid1.DisplayLayout.Bands[0].Override.HeaderAppearance.BackColor =
GridColumnHeaderBackgroundColor;

By doing so, I noticed that when I hover over a column, it does not get highlighted anymore.
Is there a way I can make it work again?

Thanks,

Annie

  • 469350
    Verified Answer
    Offline posted

     Hi Annie, 

    The highlighting you are referring to is part of the Windows Theming API. So by turning off themes, you lose the hightlighing. And you have to turn off themes in order to change the BackColor because the Theming API is all or nothing.

    So you probably can't get exactly the same highlighting. But you can get the headers to HotTrack.You would this by setting the HotTrackHeaderAppearance on the override. So it might look something like this:

            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                e.Layout.Bands[0].Override.HeaderAppearance.ThemedElementAlpha = Infragistics.Win.Alpha.Transparent;
                e.Layout.Bands[0].Override.HeaderAppearance.BackColor = Color.Red;
                e.Layout.Bands[0].Override.HotTrackHeaderAppearance.BackColor = Color.Green;
            }