Print Page | Close Window

HOWTO: Colorize group rows

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=12970
Printed Date: 29 September 2024 at 9:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HOWTO: Colorize group rows
Posted By: mgampi
Subject: HOWTO: Colorize group rows
Date Posted: 18 December 2008 at 4:31pm
Hi;
I try to set different colors on group rows. So I overwrite CXTPReportControl::GetItemMetrics() and set the color when a group row is detected. Everything works fine, except when the control initially does not have the input focus. In this case, the group row is still drawn with default colors.

My code looks like this:

void CXRReportConfirmReportCtrl::GetItemMetrics(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics) {
    if (pDrawArgs->pRow->IsGroupRow()) {
        CXTPReportGroupRow* pRow=reinterpret_cast<CXTPReportGroupRow*>(pDrawArgs->pRow);
        if (!pRow->IsSelected() && pRow->GetGroupLevel()==0)
            pItemMetrics->clrBackground=RGB(238, 199, 81);
        }
    }
}


Any ideas?


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



Replies:
Posted By: mgampi
Date Posted: 18 December 2008 at 5:16pm
OK!
Found the solution myself. Had to do with the if statement used to determine if the color should be applied.



-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



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