Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - HOWTO: Colorize group rows
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOWTO: Colorize group rows

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: HOWTO: Colorize group rows
    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 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
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.