Print Page | Close Window

Control key behaviour in multiple 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=19853
Printed Date: 21 December 2024 at 10:10pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Control key behaviour in multiple selection
Posted By: apautrot
Subject: Control key behaviour in multiple selection
Date Posted: 12 June 2012 at 11:55am
Hi
I'm using the report control of Codejock v15.13
It seems that there is no way to deselect a selected row with the control key.
I can't unselect a row, I can only clear the selection then select individual rows with control key.
I was waiting the control to work like standard list view, and have the behaviour of inverting the selection of the clicked row when the control key was pressed.

Here is my configuration of the report :

_report.GetReportHeader() -> AllowColumnReorder ( TRUE );
_report.SetMultipleSelection ( TRUE );
_report.FocusSubItems ( TRUE );
_report.AllowEdit ( TRUE );
_report.EditOnClick ( TRUE );

I can see the line 3483 in file XTPReportControl.cpp

m_pSelectedRows->Invert(pRow);

..which never invert the selection, because the pRow is never selected when this line is reached.

Could you please tell me if the control key should allow to unselect individual selected rows, or if it is an awaited behavior ?

Thank you.


-------------


Win 7 x64
VS 2008
CJ 15.13




Replies:
Posted By: ABuenger
Date Posted: 12 June 2012 at 7:14pm
Hi,

please update to the latest version.

Andre



-------------
Codejock support


Posted By: apautrot
Date Posted: 18 June 2012 at 5:29am
Hi
I have tried the latest version 13.3.1
I can isolate the problem with the sample ReportCustomHeap. Uncommenting the two lines at 119
wndReport.AllowEdit(TRUE);
wndReport.FocusSubItems(TRUE);
to get edition of sub items.
When holding control key, I can add to selection. But holding control + click on an already selected row clears the selection.

I have digged into the code and put a breakpoint in CXTPReportSelectedRows::Clear.
The handling of button click (on up event) in OnClick calls EditItem that calls SetFocusedRow with a default value false for parameter bControlKey, which is leading to clearing the actual selection.

I will try a quick fix until you state on that, can you take a look please ?



-------------


Win 7 x64
VS 2008
CJ 15.13



Posted By: apautrot
Date Posted: 18 June 2012 at 5:44am
I have fixed that by replacing the line 5823 of file XTPReportControl.cpp
SetFocusedRow(pItemArgs->pRow);
with
bool bKeyControl = (::GetKeyState(VK_CONTROL) < 0) || m_bMultiSelectionMode;
  SetFocusedRow(pItemArgs->pRow, bKeyControl);

Works well now.


-------------


Win 7 x64
VS 2008
CJ 15.13




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