Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - How to implement OnSelectionChanging?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to implement OnSelectionChanging?

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1155
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: How to implement OnSelectionChanging?
    Posted: 28 June 2007 at 11:39am
Hi;
does anyone know how to implement a OnSelectionChanging function into the report control to have an opportunity to cancel any outstanding changes to the currently focused row?
 
It would be fine if the control sends a XTP_NM_REPORT_SELECTIONCHANGING notification to the owner of the control before the new row gets selected. I looked into the report samples with no success.
So any hints on how to do it are very welcome... 
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 05 July 2007 at 3:46pm
Hi,

There is an XTP_NM_REPORT_SELCHANGED event fired.
 
Remember currently focused row, which you don't want to change, and use CXTPReportControl::SetFocusedRow to return selection back.
 
Also use some internal flag in XTP_NM_REPORT_SELCHANGED to avoid recurrent sending of XTP_NM_REPORT_SELCHANGED event.
 
See SetFocusedRow implementation for more details.

--
WBR,
Serge
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1155
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 09 July 2007 at 6:12am
Hi Serge,
you solution works, but it first sets the focus to the new row, resulting in a unwanted flickering of selections.
Any ideas how to prevent this?
 
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.