Print Page | Close Window

Drag & Drop .Net

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=14783
Printed Date: 15 May 2024 at 11:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Drag & Drop .Net
Posted By: Boris
Subject: Drag & Drop .Net
Date Posted: 21 July 2009 at 6:55am
Hi,
 
Does anyone have code to show how Drag & Drop works in VB2005.Net.
 
Regards


-------------
Boris

Product: Xtreme SuitePro (ActiveX) version 16.4.0 16.3.1

Platform: Windows XP (32bit) - SP 3

Language: Visual Basic 6.0 SP6

VS 2005-2008-2010-2013



Replies:
Posted By: mdoubson
Date Posted: 21 July 2009 at 8:27pm
https://forum.codejock.com/uploads/20090808_120407_RcDragSortVista.rar - uploads/20090808_120407_RcDragSortVista.rar
 
 
Almost same way as in VB6:

wndReportControl.EnableDragDrop("AAA", XTPReportDragDrop.xtpReportAllowDrag + XTPReportDragDrop.xtpReportAllowDrop + XTPReportDragDrop.xtpReportAllowDragMove + XTPReportDragDrop.xtpReportAllowDragCopy)

 

Play with 2 reports - drag and drop inside one or between two controls



-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 08 August 2009 at 12:16pm
Boris - you also need to use fresh ocx for drag'n drop in Vista mode (when you have already sorted report and like to change smth after sort) -
https://forum.codejock.com/uploads/DemoVersion/ReportControlUpdated.rar - https://forum.codejock.com/uploads/DemoVersion/ReportControlUpdated.rar


-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 09 August 2009 at 4:53am
Hi Mark
 
Good extension! I use RC in the following manner:
 
12.07.2009
  A
  B
  C
  A
14.07.2009
  X
  Z
  Y
 
The report is grouped by date. Now drag & drop is not possible inside a group (e.g. moving the lower A to the upper). Moving an item shoul only be possible inside a group!
 
What do you think about that? Would this be possible to implement?
 
Thanks in advance


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 09 August 2009 at 10:06am
Yes, Fabian, I think we can apply this logical rule (should we expose extra flag to apply or not your group restriction - maybe somebody will like to ignore it by some reason?)

-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 09 August 2009 at 11:08am
I dont't know if it make sense to move an item outside a group because the group should stay intact. Moving an item outside its own group would/should destroy grouping for this column - or not?
 
Thanks again!


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 09 August 2009 at 11:17am
Logic can be different - e.g. moving record to another group can auto-change related value - in your case change datetime value.

-------------
Mark Doubson, Ph.D.


Posted By: Boris
Date Posted: 09 August 2009 at 2:35pm
Hi
 
Sorry I've only just got round to replying. However, whist I have a VB6 app that works fine it does not in VB2005.
 
I can detect the prescence of records and then just loop thyrough For Each Row in RC.SelectedRows
 
That way it works. The code that CJ supply as an example in VB6 does not.
 
 
Regards, ...
 


-------------
Boris

Product: Xtreme SuitePro (ActiveX) version 16.4.0 16.3.1

Platform: Windows XP (32bit) - SP 3

Language: Visual Basic 6.0 SP6

VS 2005-2008-2010-2013


Posted By: Fabian
Date Posted: 10 August 2009 at 1:49am
Yes, Mark. You are right! So a flag GroupMoveBehaviour as 0=Disable, 1=StayIngroup 2=MoveBetweenGroups seems to be perfect!
 
I am prepared to test it...
 
Thanks a lot!


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 13 August 2009 at 9:37am
Good - please attach it

-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 13 August 2009 at 11:09am
Hi Mark
 
don't understand. I meant you build ocx with new d&d feature and I will test it...


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 13 August 2009 at 11:14am
I got your previous post as you prepared proper test app I can use to cover all 3 cases - so I asked you to attach it
 
What is ready - OCX with proper drag and drop for unsorted and sorted cases (like Vista Windows Explorer) -
ocx - https://forum.codejock.com/uploads/DemoVersion/ReportControlUpdated.rar - https://forum.codejock.com/uploads/DemoVersion/ReportControlUpdated.rar

ready to run demo - https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStatic.rar - https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStatic.rar


-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 14 August 2009 at 1:56am
Hi Mark
 
No, I thought I can test an ocx in our application with D&D possibilities for grouped columns...
 
Thanks again 


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 14 August 2009 at 8:13am
You can - get current ocx with DD and try run your app

-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 14 August 2009 at 9:27am
Mark,
 
1. Where can I get an actual version from?
2. Had you implemented the D&D in a grouped column so that the row can not be moved outside this group:
 
14.08.2009
  A
  B
  C
  A
15.08.2009
  X
  Z
  Y
 
Y can be moved before Z but not to the group 14.08.2009 and A can be moved e.g. before B but not after X...
 
3. What property (ies) must I set to control this behaviour?
 
Thanks a lot
 


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 14 August 2009 at 9:49am
It is not restricted now - this is why I asked you test-case sample to modify code with flag GroupMoveBehaviour as 0=Disable, 1=StayIngroup 2=MoveBetweenGroups

-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 14 August 2009 at 11:20am
http://forum.codejock.com/uploads/20090814_111909_DDTest.zip - uploads/20090814_111909_DDTest.zip
 
 
 
Does this help (OCX is still V13.0)


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 14 August 2009 at 11:32am
http://forum.codejock.com/uploads/20090814_224424_DD_Fabian.rar - uploads/20090814_224424_DD_Fabian.rar
 
Thanks. Sure - this is upgrade to current 13.1
You can try it now - there is checkbox for SortedDD mode - see reaction
 
Looks like current behaviour is most logical - no need to modify something


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 14 August 2009 at 11:01pm
If somebody need VB solution with Groups and DragNDrop with auto-assignment (you select sifferent rows from different groups and drop it into another group) - you can use simple VB-level functions do it. I can give some prototype but I don't think we need it on Core level. Typical customization task.

-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 15 August 2009 at 2:55am
Hi Mark
 
I don't think that this works. Moving a row (RED LINE) is disabled as soon as you have created a group, at least in V13.0. And how can I restrict the red line to one group? It should be made invisible as soon as I move outside the starting group!
 
If I am wrong - please advice or show me in my uploaded sample.
 
Thanks in advance!
 


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 15 August 2009 at 10:32am
This is why new flag used
 
ReportControl1.SortedDragDrop = True
 
Why you are talking about 13.0?


-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 15 August 2009 at 11:07am
Because I can not change because of issue #21305 (BestFit doesn't work in 13.1). But apart from this, how can I restrict moving the red line with the newly introduced flag to a group???

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 15 August 2009 at 11:12am
BestFit working fine - did you try it PRESONALLY?

-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 15 August 2009 at 11:20am
Shure! But in the beta you sent me. it fixes the bug with the covered rightmost column by the scrollbar. But how can I accomplish the group DD? Can you show me in the sample that I made for you yesterday?
 
Thanks


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 15 August 2009 at 11:23am
Did you run your fit test-case with current ocx?

-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 15 August 2009 at 11:30am
Not yet. But you can look at it. I fit columns 1/2 in my uploaded sample of yesterday (works with 13.0). But I hope you can show me how to handle DD in a group...
 
If this really works I will install 13.1 immediately!


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 15 August 2009 at 1:32pm
See -
I simplify your code - e.g. in 
Private Sub Form_Load()
.................................
  ReportControl1.SortOrder.Add ReportControl1.Columns.Find(0)
  'ReportControl1.SortOrder.Add ReportControl1.Columns.Find(1)
  ReportControl1.GroupsOrder.Add ReportControl1.Columns.Find(0)
 
  ReportControl1.SortedDragDrop = True
  Check.Value = 1
 
End Sub
add action function -
 
Private Sub ReportControl1_RecordsDropped(ByVal TargetRecord As XtremeReportControl.IReportRecord, ByVal Records As XtremeReportControl.IReportRecords, ByVal Above As Boolean)
    Dim RepRec       As ReportRecord
    Dim i            As Integer
    
    Set RepRec = TargetRecord
   
    If Not RepRec Is Nothing Then
      For i = 0 To Me.ReportControl1.SelectedRows.Count - 1
         ReportControl1.SelectedRows(i).Record.Item(0).Caption = RepRec.Item(0).Caption
         ReportControl1.SelectedRows(i).Record.Item(0).BackColor = RGB(128, 128, 128)
      Next i
 
    ReportControl1.SortOrder.Add ReportControl1.Columns.Find(0)
    'ReportControl1.SortOrder.Add ReportControl1.Columns.Find(1)
   
    ReportControl1.GroupsOrder.Add ReportControl1.Columns.Find(0)
   
    ReportControl1.Populate
   
    End If
   
End Sub
 
 


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 15 August 2009 at 2:33pm
BestFit in your case - looks good -
 
 
Private Sub Form_Load()
  Dim ReportCol As ReportColumn
  Dim ReportRec As ReportRecord
  Dim Item As ReportRecordItem
  Dim i As Integer
  Dim w As Integer
  w = 200
  Call CJInitReport(ReportControl1)
  ReportControl1.EnableDragDrop "Report", xtpReportAllowDrop + xtpReportAllowDrag
  ReportControl1.AllowEdit = True
 
  ReportControl1.ShowGroupBox = True 'False
  ReportControl1.HideColumnAfterGroupBoxDrop = False
 
  ReportControl1.AllowColumnRemove = True
  ReportControl1.AllowColumnSort = False
  'ReportControl1.AllowColumnSort = True
  ReportControl1.PaintManager.HideSelection = True
  '---Wird nur gebraucht, um die Gruppenzeile schmaler zu machen
  ReportControl1.PaintManager.ShadeGroupHeadings = True
  ReportControl1.PaintManager.GroupShadeBackColor = RGB(245, 245, 245)
  '---
  ReportControl1.PaintManager.ShadeSortColumn = False
 
  Set ReportCol = ReportControl1.Columns.Add(0, "Date", w, True)
  Set ReportCol = ReportControl1.Columns.Add(1, "Code", w, True)
  Set ReportCol = ReportControl1.Columns.Add(2, "Price", w, True)
 
  For i = 0 To 100
    Set ReportRec = ReportControl1.Records.Add
   
    Set Item = ReportRec.AddItem(Format(Now() + i Mod 10, "short date"))
    Set Item = ReportRec.AddItem(CStr(4000 + i))
    Set Item = ReportRec.AddItem(Format$(200 + Rnd() * 10, "###,###.00"))
  Next i
 
  'ReportControl1.IconViewRowNumberSetup 0, 0, 1, 20
 
  ReportControl1.SortOrder.Add ReportControl1.Columns.Find(0)
  'ReportControl1.SortOrder.Add ReportControl1.Columns.Find(1)
  ReportControl1.GroupsOrder.Add ReportControl1.Columns.Find(0)
 
  ReportControl1.Populate
 
  ReportControl1.Columns(0).BestFit
  ReportControl1.Columns(1).BestFit
  ReportControl1.Columns(2).BestFit
 
  ReportControl1.SortedDragDrop = True
  Check.Value = 1
 
  ReportControl1.Redraw
End Sub


-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 17 August 2009 at 5:16am
OK, Mark
 
I will try it. Where from can I download the latest ReprtControl OCX for 13.1?
 
Thanks again
 


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 17 August 2009 at 10:00am
1st - get and install official 13.1 (Mid of June 2009) from CJ Store
 
2nd - get fresh upgrade here - https://forum.codejock.com/uploads/DemoVersion/ReportControlUpdated.rar - https://forum.codejock.com/uploads/DemoVersion/ReportControlUpdated.rar
unrar it on same place your official 13.1 located.
Rename the same way as official filename use
No need to re-registrate as you already had it


-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 18 August 2009 at 10:29am
Hi Mark
 
That is it! Thanks a lot
 
one more question: What for are the properties 'StrictBestFit' and 'AllowSelectionCheck'?
 
Thanks for helping hand


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 18 August 2009 at 11:09am

BOOL m_bStrictBestFit; // use BestFit only for non-autosize mode

AllowSelectionCheck - if set - you can use right button click to change checkbox state for selection


-------------
Mark Doubson, Ph.D.



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