Alternating Row color depending on value

edited July 2009 in FastReport .NET
Hello,

i've a report with a checkbox (Checkbox1) and a rectangle shape in the back of the checkbox in the subreport.
Now i want to change the color of the shape depending on if the checkbox is checked.
For this i've added an EventHandler (VB)
Private Sub CheckBox1_BeforePrint(ByVal sender As object, ByVal e As EventArgs)
      If checkbox1.Checked Then
        Shape1.FillColor=Color.Red 
      Else
        Shape1.FillColor=Color.Transparent 
      end if  
    End Sub

But the curios is that the color of the following line(shape) is changed, not of the current.

how can i modify the script to fit my needs?

Thanx in advance, hematec

Comments

  • edited 5:23PM
    Hello,

    Use another event, AfterData, instead of BeforePrint. In the BeforePrint event, you cannot analyze the Checked property because the object is not filled with data yet.
  • edited 5:23PM
    Thank you - now it behaves like expected.

Leave a Comment