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
415
Ultragrid rows display alternate row back color
posted

HI,

I set up an Ultragrid with alternate row color by running following codes after the grid was populated with data: 

 For x = 0 To anICDs.GetUpperBound(0)  

     For y = 0 To Me.Rows.Count - 1 

         If CInt(Me.Rows(y).Cells("Position").Value) - 1 = anICDs(x) Then  

          Me.Rows(y).Appearance.BackColor = CType(IIf(x Mod 2 = 0, Color.White, Color.GreenYellow), Color)  

        End If 

    Next 

Next

I works during display time. But when I insert a blank row into the grid, the backcolor is still the default gray (see row 3,4), I would like the blank row to have the same GreenYellow color.  Is there a grid property I can set to accomplish this? Or is there an event I can duplicate the above code in?

Thank you.