Print Page | Close Window

beforedrawrow setting backcolor

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=20540
Printed Date: 27 November 2024 at 8:16am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: beforedrawrow setting backcolor
Posted By: xfsriddler
Subject: beforedrawrow setting backcolor
Date 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

  



Replies:
Posted By: xfsriddler
Date 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.


Posted By: bryanu
Date 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


Posted By: xfsriddler
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net