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
675
Overwriting Style for specific rows in a grid
posted

If I have certain rows that I want to change the font color, while the whole UltraGrid is using a style library, how do I do that? I tried to set the CellAppearance.ForeColor to that row, but it didn't change. How do I overwrite Stylelibrary settings for a specific row?

 

Thanks.

 

 

Richard Zhu 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Richard,

    AppStylist shouldn't be overriding the appearance properties for an individual row or cell. Exactly what object are you setting the CellAppearance of?

    Just as a test, I tried loading pear.isl into a project with a grid and using the following code:


            private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
            {
                if (e.Row.Index % 2 == 0)
                {
                    e.Row.CellAppearance.ForeColor = Color.Red;
                }
            }

    This worked fine for me and every even-numbered row in the grid showed up red.

     

Children