Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - beforedrawrow setting backcolor
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

beforedrawrow setting backcolor

 Post Reply Post Reply
Author
Message
xfsriddler View Drop Down
Groupie
Groupie


Joined: 22 February 2010
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote xfsriddler Quote  Post ReplyReply Direct Link To This Post Topic: beforedrawrow setting backcolor
    Posted: 18 January 2013 at 11:32am
I have setup the BeforeDrawRow event to color a column's backcolor differently 
depending on it's value.  This seems to work perfectly except the very first data row (not the heading row) is not being colored , it is staying the default color.
Can you direct me to what I am doing wrong ?

Private Sub prodgrid_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
  
Select Case Item.Index
  Case 5
    If Item.Value > 0 Then
       Metrics.BackColor = &H9FFBA9
    Else
       Metrics.BackColor = &H9D9DFF
    End If
Case Else
    Metrics.BackColor = "-1"
End Select
  
End Sub

  
Back to Top
xfsriddler View Drop Down
Groupie
Groupie


Joined: 22 February 2010
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote xfsriddler Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2013 at 4:28pm
Anyone have any ideas on this one, it's really annoying, the top
data row (not heading) on all my reportcontrols does not change color
when I set it , every other row works fine.
Back to Top
bryanu View Drop Down
Groupie
Groupie
Avatar

Joined: 19 February 2007
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote bryanu Quote  Post ReplyReply Direct Link To This Post Posted: 06 April 2013 at 4:14pm
Without seeing more of your code, it looks like the issue is with your comparative:

If Item.Value > 0 Then ...

You are not changing the color of the item with a value of 0.

Try:    If Item.Value >= 0 Then
Suite Pro v16.3.1

Visual Basic 6.0 ENT sp6

Windows 8.1
Back to Top
xfsriddler View Drop Down
Groupie
Groupie


Joined: 22 February 2010
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote xfsriddler Quote  Post ReplyReply Direct Link To This Post Posted: 30 April 2013 at 12:39pm
It is an IF/Then statement, it is supposed to one color if it's greater than 0
and one color if it's not zero or less.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.