Print Page | Close Window

[not bug] Cancel selection change

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=18854
Printed Date: 31 May 2025 at 9:55am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [not bug] Cancel selection change
Posted By: mgampi
Subject: [not bug] Cancel selection change
Date Posted: 23 August 2011 at 8:26am
Hi;

I try to cancel a selection change in XTP_NM_REPORT_SELCHANGING message but can't get it to work.
Normally I expect the LRESULT* Result parameter to be set to FALSE to cancel the change of selections, but this does not work.
So I moved over to XTP_NM_REPORT_FOCUS_CHANGING, because this message handler provides a XTP_NM_REPORTREQUESTEDIT structure that has a bCancel flag inside.
The cancel flag is returned to the calling toolkit function (Apply == not Cancel) but afterwards the focus is still changed.
In any case I think it's definitely buggy how the control handles these messages...

Nevertheless, has anyone ever succeeded in canceling the change of selection when a special condition is met?



-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Replies:
Posted By: ABuenger
Date Posted: 24 August 2011 at 1:13pm
Hello everybody,

the LRESULT value of XTP_NM_REPORT_SELCHANGING will now be evaluated and if unequal 0 the action will be aborted. I've also added a XTP_NM_REPORT_LBUTTONUP notification.



uploads/1755/ReportSample_18854.zip - uploads/1755/ReportSample_18854.zip

Andre



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


Posted By: mgampi
Date Posted: 04 December 2012 at 4:17am
Hello Andre;

I've just tried to use the new functionality, but it's not usable.
The XTP_NM_REPORT_SELCHANGING notificationis received two times. The first time with type "Clear" the second time with type "Add".
In the first event I set the cancel flag, so I expect that no more "Add" notification should arrive, due to the fact that I cancel the selection change!
When looking at the CJ code, I can see that the Add function is invoked in any case! IMHO "Add" should only be called when "Clear" is not canceled!


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: mgampi
Date Posted: 13 April 2017 at 3:13am
Just tested with 17.3.0 and it's still the same!
There is no straight way to cancel a change in selection and focus. Digging into XT code shows that the cancel information ist not used in further processing.

This is definitely a BUG in XT code CryCryCry! I hope it's going to be fixed soon, because I reported this issue several years ago!




-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: olebed
Date Posted: 04 May 2017 at 8:04am
Hello Martin,

xtpReportSelectionClear and xtpReportSelectionAdd  is different events in single notification XTP_NM_REPORT_SELCHANGING. Also there is xtpReportSelectionRemove.

So when you select other row  then first called  Clear  then  Add  new row to selected rows array.
If you cancel Clearing then previous selected row leave in selection, like you select with pressing [Ctrl] key.
If you cancel Adding  then row will not added to selection.

Regards,
 Oleksandr Lebed


Posted By: mgampi
Date Posted: 04 May 2017 at 8:20am
Hello;

I know all those different parts, but it's annoying to have large effort for such a 'small' thing?
Especially when in single selection mode...

Martin


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



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