Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Drag & Drop in Tree View - Sub items supported?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Drag & Drop in Tree View - Sub items supported?

 Post Reply Post Reply
Author
Message
coretech View Drop Down
Newbie
Newbie


Joined: 03 March 2008
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote coretech Quote  Post ReplyReply Direct Link To This Post Topic: Drag & Drop in Tree View - Sub items supported?
    Posted: 03 March 2008 at 9:32am
Hi. I have designed a report control that supports parent-child relationships (i.e. a tree) with drag & drop enabled. Drag & drop with top-level items works well but I am unable to drop an item into a sub item position.

For example, when I have the following items/hierarchy:

Row1
Row1,1
Row1,2
Row1,3
Row2
Row3

When I drag Row3 to between Row1,1 and Row1,2 and release, it is dropped into Row2 - not into Row1,2 as expected.

Is this a bug? How can I work around it?

I am using toolkit version 11.2.1.

Thanks!
Back to Top
Rafael View Drop Down
Newbie
Newbie
Avatar

Joined: 26 November 2007
Location: United States
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rafael Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2008 at 11:27am
You will need to catch the DropRecordsEx event and get the record you dragged from the Records param and you know where you dropped it from the TargetRecord and Above Params.
 
Then add the record you dragged as a child to the right target record (which probably will not be in TargetRecord param, but the record above)
Back to Top
Rafael View Drop Down
Newbie
Newbie
Avatar

Joined: 26 November 2007
Location: United States
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rafael Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2008 at 11:40am
Actually you will need to add the dragged record as the child of row 1 not row 1,1 to have the affect your looking for
Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Posted: 18 June 2008 at 1:42am
But DropRececords doesnt have any information about where you have come from nor where you are now, so how would you do it?

As far as I can see, you need to completely write your own when this ought to be covered by default in the base class ... if you have tree view, then of course you want to drag into the children and not just top level as its broken for everybody in its current state.

Could this be resolved by Codejock?
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.156 seconds.