Print Page | Close Window

Virtual Report and Checkboxes

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=3247
Printed Date: 27 April 2024 at 3:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Virtual Report and Checkboxes
Posted By: rock
Subject: Virtual Report and Checkboxes
Date 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()?




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


Posted By: rock
Date Posted: 21 November 2005 at 12:08pm
Works perfectly.  Thanks



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