Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Virtual Report and Checkboxes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Virtual Report and Checkboxes

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


Joined: 27 October 2005
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote rock Quote  Post ReplyReply Direct Link To This Post Topic: Virtual Report and Checkboxes
    Posted: 18 November 2005 at 11:00am

I have a window with a CXTPReportControl and I am using SetVirtualMode() for a database search result.  It works fine and properly displays the information.  The first column of the report is a check box.  The column was added using the AddItem() function in a CXTPReportRecord derived class.  The class passed to AddItem() is a CXTPReportRecordItem derived class exactly like the CMessageRecordItemCheck class in the report sample.  When I click on any checkbox in the Report Control, all the items in the report become checked or unchecked instead of just the one clicked on.  Is this functionality not possible in a virtual report?  Or will I have to deal with this somehow within the Report Record class during GetItemMetrics()?

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 19 November 2005 at 3:37pm
Hi,

Note that adding an item to the virtual report row means only adding a kind of item substitute. In order to show data of the specific row you should add a kind of the following code:


void GetItemMetrics (XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics)
{

     ...

     if (pDrawArgs->pColumn->GetIndex() == COLUMN_CHECK_INDEX)
     {
           pDrawArgs->pItem->SetChecked(bYourValue);
     }

     ...

}


--
WBR,
Serge
Back to Top
rock View Drop Down
Groupie
Groupie


Joined: 27 October 2005
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote rock Quote  Post ReplyReply Direct Link To This Post Posted: 21 November 2005 at 12:08pm
Works perfectly.  Thanks
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.171 seconds.