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 8:26AM
    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 8:26AM
    Thank you - now it behaves like expected.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.