Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - HOWTO: Prevent Drop from report 1 to report 2
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOWTO: Prevent Drop from report 1 to report 2

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

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: HOWTO: Prevent Drop from report 1 to report 2
    Posted: 20 July 2009 at 5:23am
Hi;

I created an MDI application that contains report controls of same type and content in different views. It should be possible to use drag & drop to rearrange items within one report control but not to move/copy records from one report control to the other using drag & drop.
Ho can I 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
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2009 at 4:48pm
Use app level to receive OnDragBegin notification and OnDragOver
Change dynamically m_dwDragDropFlags for all reports except originator to not allow to drop state using CXTPReportControl::EnableDragDrop funciton. Now you can drop you records only inside originator report control
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 22 July 2009 at 3:29am
Hi;
I did it al little bit different. Since I don't wnat to enumerate all active report control instances I decided to use a bool flag that is set when a drag operation starts and reset after a drop. In all other report control instances, this flag can't be set. Flag not set --> drop disabled.
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
perrianna View Drop Down
Newbie
Newbie


Joined: 11 August 2009
Location: India
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote perrianna Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2009 at 9:14am
 
To prevent the drag and drop property of your XTPReport Control, Pass NULL value to the EnableDragDrop function.
This will disables the drag and drop operation.
 
       rptMemberVar.EnableDragDrop(_T("Class"), NULL);
 
 
Override the OnBeginDrag, OnDrop method to customize your drag and drop operations.
 
=======================================
 
 
hi everyone...
 
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 12 August 2009 at 8:50am
Originally posted by perrianna perrianna wrote:

 
To prevent the drag and drop property of your XTPReport Control, Pass NULL value to the EnableDragDrop function.
This will disables the drag and drop operation.
 
       rptMemberVar.EnableDragDrop(_T("Class"), NULL);
 
 
Override the OnBeginDrag, OnDrop method to customize your drag and drop operations.
 
=======================================
 
 
hi everyone...
 
Hi;
as mentioned before, I solved it already! I don't want to disable drag&drop completely, I only wanted to disable drag&drop between different instances of the same report control class.
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.141 seconds.