Print Page | Close Window

(un)checking all rows of the selection

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=14410
Printed Date: 28 April 2024 at 5:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: (un)checking all rows of the selection
Posted By: inmaurik
Subject: (un)checking all rows of the selection
Date Posted: 29 May 2009 at 4:21am
I would like to be able to check/uncheck all rows of the selection in the ReportGrid.

In CXTPReportRecordItem::OnClick a XTP_NM_REPORT_CHECKED message is send but at that moment the selection is already removed by the SetFocusedRow statement in CXTPReportControl::OnLButtonUp.

Is there a way to achieve this functionality (like the Pending Changes view in Visual Studio) or can this be added to the next release because I see no way to prevent the removal of the selection if the user clicks the glyph area of the record item.

-------------
Product: Xtreme SuitePro (MFC) version 13.3.1
Platform: Windows 7 Enterprise (64bit)
Language: C++ (Visual Studio 2008 SP1)



Replies:
Posted By: mdoubson
Date Posted: 29 May 2009 at 2:21pm

Need non-item related function (Control level) - SetSelectionState(int state) where state can be 0, 1 or 2 (tristate checkbox). But if row / record have more than one checkboxes? So need smth like SetSelectionState(int index, int state). And you need to have menu (fixed or context) or button for UI to call this function and different buttons for several checkboxes in row

I made this function (SetSelectionState) - be in 13.1
 
Another idea - you can implement support of RightButton click (this one keep selection)


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 29 May 2009 at 7:04pm
I add to ReportControl experimental flag to support checking with Right button mouse and keep selection same time. Is it enough for you? Or you want this click do some extend work: change check state of item you right click on and duplicate this state on all other same column items inside selection?
This is not difficult and we can add extra flag to allow or not such action extension


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 29 May 2009 at 7:20pm
Finally I implemented both flags and you can try to play with this feature in static sample https://forum.codejock.com/uploads/DemoVersion/ReportSampleSatic.rar -
 
https://forum.codejock.com/uploads/DemoVersion/ReportSampleSatic.rar  
 
There are couple of columns with checkboxes in the right part - scroll if not see it.
Both flags set ON in this app so your action will extend for all selection
 
I also expose this feature in simplified form to ActiveX -  it set both flags with same value and return it if you ask
wndReportControl.AllowSelectionCheck = True
I also add accelerator Ctrl+A to select all records in Report Body


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 30 May 2009 at 1:23am
Only now I recoginized that this is typo in demo file name - I will keep it for prev version and now upload new one:
 
https://forum.codejock.com/uploads/DemoVersion/ReportSampleStatic.rar - https://forum.codejock.com/uploads/DemoVersion/ReportSampleStatic.rar
 
Compare prev and last version in PreviewMode - it was a bug with Header Rows and nobody never report it!


-------------
Mark Doubson, Ph.D.


Posted By: inmaurik
Date Posted: 03 June 2009 at 7:27am
Using the right-click to set the selection is not an option because our users are used to using the left button-click.

I however managed to get it working in the same way like Visual Studio 2008 Pending Changes with the current CodeJock version (13.0).

I have set AutoCheckItems to FALSE because I only want the check-box to be checked when the user clicks on the check box and not on the other part of the record item.

In the OnLButtonUp of my CXTPReportControl class I check if the clicked row = m_pSelectOnUpRow. If this is true and the user clicked on the check box area (I am using a helper function on my implementation of CXTPReportRecordItem), the m_pSelectOnUpRow is set to NULL and the focus is set to the clicked row (with bIgnoreSelection = TRUE).

The XTP_NM_REPORT_CHECKED message is handled by my CXTPReportControl class and sets the check state of all selected rows to the inversed value of the clicked row (only when the click is on the check box area).

The function SetSelectionState can be handy but does not complete the whole job. A function on CXTPReportRecordItem or CXTPReportRow to check if a point is in the check box area of the row/item would also be very usefull (e.g. HitCheckboxTest).



-------------
Product: Xtreme SuitePro (MFC) version 13.3.1
Platform: Windows 7 Enterprise (64bit)
Language: C++ (Visual Studio 2008 SP1)



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