![]() |
Coloring Report Control Rows ! |
Post Reply
|
| Author | |
Maneesh
Newbie
Joined: 02 May 2005 Status: Offline Points: 16 |
Post Options
Thanks(0)
Quote Reply
Topic: Coloring Report Control Rows !Posted: 02 November 2005 at 11:55pm |
|
On click of a botton in my dialog I would like set the background color for a particular row. Iam using CXTPReportControl ! Please provide me with the code to color a row ! Can I set a background color only for a Row and a Column ! Pls let me know ! Thanks Maneesh |
|
![]() |
|
Warren
Groupie
Joined: 23 February 2005 Status: Offline Points: 64 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 November 2005 at 9:53pm |
|
you might want code something like:
void YourCXTPReportRecordDerivedClass::GetItemMetrics(XTP _REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics) { ASSERT( (NULL!=pDrawArgs) && (NULL!=pItemMetrics) ); if( (pDrawArgs->pRow->GetIndex() == rowNumberYouWantToColour) && (!pDrawArgs->pItem->IsPreviewItem()) ){ pItemMetrics->clrBackground = RGB(245, 245, 245); } } see Codejock Samples--> ReportSample-->MessageRecord.cpp-->CMessageRecor d::GetItemMetrics Hope that helps... Warren |
|
![]() |
|
Maneesh
Newbie
Joined: 02 May 2005 Status: Offline Points: 16 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 November 2005 at 10:18pm |
Thanks Warren ! But this function is called when the populate() fn of the rpt cnt is called, i.e when the record is initially shown the back color is applied ! my requirement is there are already around 10 records shown and when a user clicks a button .. the 2 row should be colored ! i hope u understand ! Maneesh |
|
![]() |
|
sserge
Moderator Group
Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 November 2005 at 2:37am |
|
Maneesh,
There is only one way to customize colors - override GetItemMetrics or catch corresponding notification - XTP_NM_REPORT_GETITEMMETRICS. But you can apply that for following classes: CXTPReportRecordItem::GetItemMetrics CXTPReportRecord::GetItemMetrics CXTPReportRow::GetItemMetrics I can't see what is a problem to call Populate. May be try to call RedrawControl instead of Populate. -- HTH, Serge |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |