(un)checking all rows of the selection |
Post Reply |
Author | |
inmaurik
Groupie Joined: 13 July 2007 Location: Netherlands Status: Offline Points: 17 |
Post Options
Thanks(0)
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) |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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)
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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
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
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Only now I recoginized that this is typo in demo file name - I will keep it for prev version and now upload new one:
Compare prev and last version in PreviewMode - it was a bug with Header Rows and nobody never report it!
|
|
inmaurik
Groupie Joined: 13 July 2007 Location: Netherlands Status: Offline Points: 17 |
Post Options
Thanks(0)
|
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) |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |