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
20
Group by column - sum on another column - format negative number
posted

Hi,

This is my first post here so please bear with me !

I have an UltraWinGrid in which I have a sum on an 'Amount' column.

When I group by my 'Product' column, the sum of that 'Amount' column appears on for every grouped product.

What I would like to do is display that summed amount in red if the number is negative.

How would this be possible ?

Thanks a bunch.

Marc

  • 469350
    Offline posted

    Hi Marc,

    Here's some sample code:


            private void ultraGrid1_SummaryValueChanged(object sender, SummaryValueChangedEventArgs e)
            {
                if ((int)e.SummaryValue.Value < 0)
                    e.SummaryValue.Appearance.ForeColor = Color.Red;
                else
                    e.SummaryValue.Appearance.ForeColor = Color.Black;
            }