Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPReportSelectedRows
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPReportSelectedRows

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


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Topic: CXTPReportSelectedRows
    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

Back to Top
spike View Drop Down
Groupie
Groupie


Joined: 13 May 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote spike Quote  Post ReplyReply Direct Link To This Post 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.

 

 

Back to Top
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post 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++;
  }
 }



Edited by Italo
Back to Top
spike View Drop Down
Groupie
Groupie


Joined: 13 May 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote spike Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2004 at 11:33am
Why would you do that? Just loop the rows collection calling isSelected on each row?
Back to Top
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post 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.
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.156 seconds.