We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to create Drag and drop effect on treeview adv and custom control

Hello,
I am using treeview adv having grid grouping control as a child for every node of that tree view.
I want to drag records of one grid and drop into another grid of different nodes.
Is there any way for this?

Regards,
Rasika

5 Replies

SK Senthil Kumaran Rajan Syncfusion Team July 15, 2015 01:06 PM UTC

Hi Rasika,

Thank you for your update.

The reported requirement can be achieved by handling the DragDrop, DragOver and TableControlMouseDown events in GridGroupingControl. We have prepared the sample and the video based on the reported requirement and it can be downloaded from the below location.


Sample Location : http://www.syncfusion.com/downloads/support/forum/119603/ze/TreeCustom-1656668409


Video Location : http://www.syncfusion.com/downloads/support/forum/119603/ze/DragDropGridGrouping1726062271


Please refer the below knowledge base documentation for further reference.


KB link : http://www.syncfusion.com/kb/581/how-to-drag-and-drop-in-the-gridgroupingcontrol

Please let us know if you need further assistance.

Regards,
Senthil



RA Rasika July 17, 2015 05:37 AM UTC

Hello,
Thank you for the reply.
The demo you provided was really helpful for me and I implemented that in my code.
But there was a problem when I drop the record into the grid.
When I debug my application through breakpoints the following code from grid_dragdrop event does not working properly.

                                    for (col = 0; col < drv.Row.ItemArray.GetLength(0); col++)
                                    {                                        
                                        if (col < targetDRV.Row.ItemArray.GetLength(0))
                                        {
                                            targetDRV[col] = drv[col];
                                        }
                                    }
The problem is that the for loop does not give me proper iterations.It automatically ends at  the line targetDRV[col] = drv[col], when col value=0.
I don't know why this problem is occurring if the record, targetDRV and drv are showing proper results while debugging the application.
The effect of this is the record does not drop to the targeted grid.Please suggest me any solution for this.

Thank you and regards,
Rasika



SK Senthil Kumaran Rajan Syncfusion Team July 17, 2015 12:43 PM UTC

Hi Rasika,

Thank you for your update.

We have analyzed the reported scenario. The loop that you have mentioned is working fine. We have prepared the video for your reference and it can be downloaded from the below location. Could you please ensure that you have used ListBoxSelectionMode in your sample and please let us know the Syncfusion version that you are using. For better way to track the issue, please replicate the reported scenario in the sample provided and get back to us. So, that it would be easy for us to track the issue.


Video Location : http://www.syncfusion.com/downloads/support/forum/119603/ze/CustomGridGrouping615032878


Please let us know if you have any other concerns.


Warm Regards,

Senthil



RA Rasika July 18, 2015 06:17 AM UTC

Hello,
Thank you for your update.But the problem is still there.
I used the AfterExpand event of tree view in which I wrote
GridGroup.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended
I am providing a sample video of my code.Please check it and suggest me the solution.

Thank you and regards,
Rasika

Attachment: TreeViewGrid_Video_e20b8b0b.rar


SK Senthil Kumaran Rajan Syncfusion Team July 20, 2015 12:48 PM UTC

Hi Rasika,

Thank you for your update.

We could not able to reproduce the reported behavior in normal cases. Additionally from the provided video we suspect you have initialized AllowSelection enum as an GridSelectionFlags.Row in GridGroupingControl. Please change the GridSelectionFlags as none as in the following code snippet.


Code Snippet[C#]:

   GridGroup.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.None;


Could you please modify this and let us know whether the reported issue is resolved. If not could you please let us know what are the additional properties and enums you have initialized on your GridGroupingControl? That will be helpful for us to analyze and provide you a prompt solution as early as possible.

Please let us know if you need further assistance.

Regards,
Senthil


Loader.
Up arrow icon