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

selected rows and checkboxes...

 Post Reply Post Reply
Author
Message
ddlittle View Drop Down
Senior Member
Senior Member


Joined: 19 February 2004
Location: United States
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddlittle Quote  Post ReplyReply Direct Link To This Post Topic: selected rows and checkboxes...
    Posted: 20 November 2008 at 4:23pm
I have a report control with a checkbox in column zero.  When I select several rows and click a checkbox in one of those rows, I want the checkboxes to all turn on (or off).  I tried iterating through the selected rows, but it seems that clicking the checkbox changes the selection count to one, because I never iterate more than once. 
 
Do I need to do something else to find the underlying selection?  The selection remains highlighted.
 
Here's a stub of my code, in case you see something there:
 

void CDrawingPropertiesWnd::OnReportButtonCheck(NMHDR* pNotifyStruct, LRESULT* result)

{

XTP_NM_REPORTRECORDITEM* pItemNotify = (XTP_NM_REPORTRECORDITEM*) pNotifyStruct;

int nColumn = pItemNotify->pColumn->GetItemIndex();

CXTPReportRecordItemCheckbox* cb = (CXTPReportRecordItemCheckbox*)pItemNotify->pItem;

switch(nColumn)

{

case columnShowHide:

{

CXTPReportRecordItemCheckbox* cb = (CXTPReportRecordItemCheckbox*)(pItemNotify->pItem);

BOOL bVis = (cb->IsChecked() ? TRUE : FALSE); // value to set for all selected rows...

CXTPReportSelectedRows* rows = m_DrawingReport.GetSelectedRows();

for(int xx=0;xx<rows->GetCount();xx++)

{

CXTPReportRow* row = rows->GetAt(xx);

int nRow = row->GetIndex();

CXTPReportRecordItemCheckbox* cbShowHide = (CXTPReportRecordItemCheckbox*)row->GetRecord()->GetItem(columnShowHide);

cbShowHide->SetChecked(bVis);

OnShowHide(cbShowHide,nColumn,nRow);

}

}

break;

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.172 seconds.