Print Page | Close Window

selected rows 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=12745
Printed Date: 29 September 2024 at 9:19pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: selected rows and checkboxes...
Posted By: ddlittle
Subject: selected rows and checkboxes...
Date 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;




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