I would like to have 2 different colors for the alternate row color in one grid (only 1 band).
For rows of type X I use the value assigned to :
this.ultraGrid1.DisplayLayout.Override.RowAlternateAppearance.BackColor
But for rows of type Y I am trying to override this using the initialize row event...I try to do this
// first test for type Y row...if (row.IsAlternate)
{ row.Appearance.BackColor = Color.Green; }
However, when I view the results, the type Y rows do not alternate, they clump up in 2, 3 or more green rows in sequence.
Is there anything I am doing wrong here?
Hi,
My guess is that a row may be changing to and from an alternate at various staging of your application. For example, if you filter or sort the rows the some rows will become alternates and some that were alternates will become non-alternates. It's this latter group that is the problem, since the code you posted here never resets the appearance on the non-alternate rows.
You probably just need to add an else block and reset the row appearance for rows that are not alternates.