Drag & Drop .Net |
Post Reply |
Author | |
Boris
Senior Member Joined: 21 June 2007 Location: United Kingdom Status: Offline Points: 179 |
Post Options
Thanks(0)
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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) -
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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?)
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Logic can be different - e.g. moving record to another group can auto-change related value - in your case change datetime value.
|
|
Boris
Senior Member Joined: 21 June 2007 Location: United Kingdom Status: Offline Points: 179 |
Post Options
Thanks(0)
|
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 |
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Good - please attach it
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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) -
ready to run demo - https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStatic.rar |
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
You can - get current ocx with DD and try run your app
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
Product: Xtreme SuitePro (ActiveX) version 16.2.3
Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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.
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
This is why new flag used
ReportControl1.SortedDragDrop = True
Why you are talking about 13.0?
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
BestFit working fine - did you try it PRESONALLY?
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Did you run your fit test-case with current ocx?
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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 |
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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
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 |
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
BOOL m_bStrictBestFit; // use BestFit only for non-autosize modeAllowSelectionCheck - if set - you can use right button click to change checkbox state for selection
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |