Posted 4 February 2018, 5:49 am EST
Hi
I try to use drag and drop in Heirarchical.
I only success to do in the first level, but in e.sheetview I not success.
See my code, is it possible to do?
Forums Home / Spread / Spread for WinForms
Posted by: patrik on 4 February 2018, 5:49 am EST
Posted 4 February 2018, 5:49 am EST
Hi
I try to use drag and drop in Heirarchical.
I only success to do in the first level, but in e.sheetview I not success.
See my code, is it possible to do?
Posted 5 February 2018, 8:05 pm EST
Hello,
You can handle the ChildWorkbookCreated event and set the AllowDragDrop AllowRowMove property there. For example:
Private Sub FpSpread1_ChildWorkbookCreated(sender As Object, e As FarPoint.Win.Spread.ChildWorkbookCreatedEventArgs) Handles FpSpread1.ChildWorkbookCreated
e.Workbook.AllowRowMove = True
e.Workbook.AllowDragDrop = True
End Sub
I hope it helps.
Thanks,
Deepak Sharma
Posted 6 February 2018, 5:19 am EST
I have added this in my project, but I don’t understand where I get the event if I hold my mouse over the row and where I get information that the drop have been made.
Posted 7 February 2018, 1:49 am EST
Hi Patrik,
Dragging row/column/selection from one Spread to another is not an inbuilt feature. You can handle the MouseDown/Mouse Up events to know when drag started and stopped. You can refer to the demo sample:
C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\Samples\Cs\SpreadWinDemo\Features\DragDrop.cs
Thanks,
Deepak Sharma
Posted 7 February 2018, 8:54 am EST
Forms\v11.40.20177.0\Samples\Cs\SpreadWinDemo\Features\DragDrop.cs
I have use this sample in my code I uploaded, my questions was in next level in Heirarchical
e.SheetView…
Posted 11 February 2018, 10:02 pm EST
This is something I can’t do or?
Posted 13 February 2018, 1:05 am EST
Hi Patrik,
Since drag and drop from outside Spread is not a built in feature I did not find an easy way to implement it for chidview. It would require mouseup/mousedown/dragover/dragdrop events handled for both parent views and childviews.
Thanks,
Deepak Sharma
Posted 5 August 2020, 7:52 pm EST
I still havent success with this.
How do I access to parent and childview, with code below I guess I not access in a proper way.
Private Sub FpSpread2_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles FpSpread2.DragOver Dim p As Point = FpSpread2.PointToClient(New Point(e.X, e.Y)) Dim range As FarPoint.Win.Spread.Model.CellRange = FpSpread2.GetCellFromPixel(0, 0, p.X, p.Y) If range.ColumnCount = -1 And range.RowCount = -1 Then Return End If Dim sel As FarPoint.Win.Spread.Model.CellRange = FpSpread2.ActiveSheet.GetSelection(0) If Not (sel Is Nothing) Then FpSpread2.ActiveSheet.RemoveSelection(sel.Row, 0, 1, 7) End If iRow = range.Row FpSpread2.ActiveSheet.AddSelection(range.Row, 0, 1, 7) End Sub
Posted 11 August 2020, 6:28 am EST
Hi,
Can you kindly share the current cod you have? It will help us investigate accordingly.
Thanks,
Posted 14 August 2020, 6:15 pm EST
Here is a sample, it’s working perfect to drop to level 1 but not to level 2DragAndDrop.zip
Posted 17 August 2020, 5:54 am EST
Thank You, Patrik.
I have forwarded it to the team for further investigation [ID: 10924] and will get back to you as soon as there is any solution/information.
Regards,
Posted 18 August 2020, 3:48 am EST
Thanks alot. it’s differcult to have the user to remeber only drop in level 1.
Posted 20 August 2020, 5:43 pm EST
Hello,
I am sorry to inform that the developers have confirmed that Spread does not support drag from parent spread (level 1) to child spread (level 2) and vice-versa. This is internal logic of spread, so it has no workaround.
~Regards,