Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [RE-OPENED] Drag&Drop in Iconview
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[RE-OPENED] Drag&Drop in Iconview

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

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Topic: [RE-OPENED] Drag&Drop in Iconview
    Posted: 02 July 2011 at 3:26am
Hi,
 
Just one question: Is Drag&Drop supported in iconview?
 
Thanks
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2011 at 8:29am
Hi,
 
This is possible Smile
 
Just set:
  • wndReportControl..EnableDragDrop "SomeString", xtpReportAllowDrag + xtpReportAllowDrop
  • and RecordsDropped event is fired whenever an icon is dropped somewhere.
Just what I need, so this has been solved the "easy way" Wink
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 5:03am
Hi,
 
I didn't see that Records are removed from the collection and "inserted" on new position... That is what I don't need!!!
 
This is what I need and hopefully someone has an idea or two Wink
How can I drag & drop without changing the original record collection? I just need to change the order of the icons.
 
Thanks a lot in advance
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 10:52am
If you can put together a small sample in IconView with icons, I can experiment for you. I've never really used IconView, so I don't want to spend too much time getting that up and running, I'd rather focus on the drag & drop part.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 11:30am
Hi Jason,
 
I really hope you have a solution, in this case I would be happy with any workaround until Andre comes up with something Wink
 
 
Thanks a lot in advance  
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 12:40pm
I haven't found anything too easy so far, but I have a couple of questions:

1) Why do you need the records collection to be in the same order before and after you move records?
2) Are you trying to have 2 different orders that records appear, one for icon view and one for report view?

If I can understand what you are trying to accomplish, I might come up with a different approach. For example, you can save the order of the records collection before the drop is completed in the DropRecordsEx. Something like:


Private mo_PreDropRecords As Collection

Private Sub ReportControl1_DropRecordsEx(ByVal TargetRecord As XtremeReportControl.IReportRecord, ByVal Records As XtremeReportControl.IReportRecords, ByVal Above As Boolean)
   Dim lo_Record As ReportRecord
  
   Set mo_PreDropRecords = New Collection
    
   For Each lo_Record In Me.ReportControl1.Records
      mo_PreDropRecords.Add lo_Record
   Next lo_Record
End Sub


Then in the RecordsDropped event, you can get the post-dropped order to do comparisons against the pre-dropped order.


Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 1:26pm
Hi Jason,
 
1) Why do you need the records collection to be in the same order before and after you move records?
 
Because I have a view which is loaded from a database and I use the record index as a key to control external connected items (for example a doorlock). The customer asked if he could change the layout of the items (icons) so the only thing I can do is changing the visual appearance (basicly changing the sortorder) I could easely create a form which will load same view only to change the sortorder (setting new .SortPriority for the reportitems) and save that into the database and in "working" view but I don't want to do that maybe as a last resort Wink
 

2) Are you trying to have 2 different orders that records appear, one for icon view and one for report view?
 
Just one view (see explanation in 1)
 
 
btw Why choose such name for enum, xtpReportAllowDragMove, it's still copying a record from one place to another. I know you have to check Help first but what a way to name an enum (I feel most enums for D&D are chosen with a raffle Tongue)
 
 
Thanks

 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 1:54pm
Could you use the Tag property of each ReportRecord to store the database ID? It might be easier than trying to fight the Drag & Drop implementation...so the Records collection order will change on Drop, and you can traverse the collection and test against the Tag property to find the database record index.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 2:06pm
Originally posted by jpbro jpbro wrote:

Could you use the Tag property of each ReportRecord to store the database ID? It might be easier than trying to fight the Drag & Drop implementation...so the Records collection order will change on Drop, and you can traverse the collection and test against the Tag property to find the database record index.
 
 
I would prefer if there would be a setting where only the records would be moved. I never used D&D before so I can't tell if it worked before (ever...)
 
Andre??? I don't mind if you join this discussion...
 
Thanks a lot Jason, for the replies, I will see what I can do and maybe just maybe Andre will have the "perfect" solution. (read: implementation Wink) within next release...
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 2:17pm
I was working on Drag & Drop with you-know-who a long time ago, but it was so painful, I gave up after a while. Maybe we can pick things up again with Andre.

I would prefer if there would be a setting where only the records would be moved

I'm a bit confused because as far as I can tell only the records are being move. What else is being moved that I am missing?


--
I've attached a slightly modified demo that tries to preserve the Record positions, by intercepting the DragDrop and modifies the SortPriority on the fly. It seems to work, but only once. After that the Drop events stop firing. It would be nice to have some way to cancel the Drop in a BeforeDropRecords event.

Here's what I have so far:
uploads/2676/IconViewDragDrop.zip

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 3:24pm

Originally posted by jpbro jpbro wrote:

I was working on Drag & Drop with you-know-who a long time ago, but it was so painful, I gave up after a while. Maybe we can pick things up again with Andre.

I would prefer if there would be a setting where only the records would be moved

 
Hi Jason,
 
Moving records isn't what I ment, moving Rows is what I basicly need Wink
 
Your demo does that but only one time hehehe, I will look at it later on.
 
Thanks a lot
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 4:09pm
uploads/2676/IconViewDragDrop2.zip

Seems we needed .SortedDragDrop = True. I've cleaned up the code a bit, but there are no comments so if you have any questions just get back to me.

It seems to be working okay, I haven't tested it too much though, so if there are any bugs, get back to me of course!


Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2011 at 4:11pm
Crap, think I screwed it up - working on a fix and I'll get back to you shortly.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 05 July 2011 at 11:26am
Sorry Aaron, I came down with a sudden fever yesterday, but I'm better today.

So far, I can get D&D to work twice now, but the bad news is that the more I fight with this, the more I think that it makes more sense to use the Tag property to store any "outside" information (such as DatabaseRecordID). You can even create a class to track multiple pieces of external information and then store instances of the class in each Tag property of each ReportRecord.

Maybe there could be a CJ implemented option to only move rows, and not affect the order of the records, but I'll leave that up to you and Andre to discuss.

Sorry I couldn't be more help.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 05 July 2011 at 11:30am
As a side note - Andre, it would be nice if Drag&Drop in IconView showed an insertion point like it does in Report view. Any chance of this being added?
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 July 2011 at 1:17pm
Originally posted by jpbro jpbro wrote:

Sorry Aaron, I came down with a sudden fever yesterday, but I'm better today.

So far, I can get D&D to work twice now, but the bad news is that the more I fight with this, the more I think that it makes more sense to use the Tag property to store any "outside" information (such as DatabaseRecordID). You can even create a class to track multiple pieces of external information and then store instances of the class in each Tag property of each ReportRecord.

Maybe there could be a CJ implemented option to only move rows, and not affect the order of the records, but I'll leave that up to you and Andre to discuss.

Sorry I couldn't be more help.

 
Hi Jason,
 
I looked up the word discuss:
SYNONYMS   discuss, argue, debate, dispute, contend. These verbs mean to talk with others in an effort to reach agreement, to ascertain truth, or to convince. Discuss involves close examination of a subject with interchange of opinions
 
What is there to discuss if you are the only one who is replying? We can discuss all we want but for what??? if no one from support joins this discussion? TongueTongueTongue
 
 
Andre, is this implementation possible in VERY near future?
  • Drag&Drop in Iconview without changing the record collection (moving Rows)
  • Would be nice if Drag&Drop in IconView showed an insertion point like it does in Report view as Jason proposed
  • Thinking out loud: Have possibility to Cancel in DroppedRecords event. We can determine the position of the drop and we could set new .SortPriority value that will force the needed layout to be shown. This shouldn't be that difficult to do...
 
Please let us know what you think of this
 
Thanks
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2011 at 6:27am
Originally posted by Aaron 
<DIV>[... Aaron
[... wrote:

Andre, is this implementation possible in VERY near future?
  • Drag&Drop in Iconview without changing the record collection (moving Rows)
  • Would be nice if Drag&Drop in IconView showed an insertion point like it does in Report view as Jason proposed
  • Thinking out loud: Have possibility to Cancel in DroppedRecords event. We can determine the position of the drop and we could set new .SortPriority value that will force the needed layout to be shown. This shouldn't be that difficult to do...
 
Please let us know what you think of this
 
Thanks
 
 
Andre,
 
What do I have to do to get your attention? (Don't say I have to use IssueTracker because it has been almost 5 days now without even a reply...)
 
Is it that hard? I just need an answer so I can move on!!!
 
Thanks
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
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.234 seconds.