Print Page | Close Window

CXTPReportSelectedRows

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=984
Printed Date: 18 July 2025 at 1:17am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPReportSelectedRows
Posted By: Italo
Subject: CXTPReportSelectedRows
Date Posted: 26 July 2004 at 2:41pm

How do I enumerate the selected rows? I can’t seem to find a way to do this.

Thanks, Italo




Replies:
Posted By: spike
Date Posted: 30 July 2004 at 3:28pm

I have just begun working with this class, the only way I have found is to loop through the rows collection (GetRows()) and pSelectedRows->Contains() or CXTPReportRow::IsSelected.

 

 



Posted By: Italo
Date Posted: 31 July 2004 at 12:47am

I added the following method to CXTPReportSelectedRows (XTPReportRows.h)

 CMap<CXTPReportRow*, CXTPReportRow*, BOOL, BOOL>* GetCollection() { return &m_mapRows; }


Afterwards I can use it like this

 CMap<CXTPReportRow*, CXTPReportRow*, BOOL, BOOL> *pSelectedCollection = GetSelectedRows()->GetCollection();
 CXTPReportRow* pRow;
 BOOL bBool = TRUE;
 int nSelRecCount = 0;

 // Determine the number of selected records
 POSITION pos = pSelectedCollection->GetStartPosition();
 while( pos!=NULL )
 {
  pSelectedCollection->GetNextAssoc(pos, pRow, bBool);

  if( pRow->GetRecord() )
  {
   nSelRecCount++;
  }
 }



Posted By: spike
Date Posted: 01 August 2004 at 11:33am
Why would you do that? Just loop the rows collection calling isSelected on each row?


Posted By: Italo
Date Posted: 01 August 2004 at 11:55am
Because I have thousands of rows and I don’t see why I should enumerate them when CXTPReportSelectedRows contains a list of all the selected rows.



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