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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

119603 Jul 14,2015 02:01 AM Jul 20,2015 08:48 AM Windows Forms 5
loading
Tags: GridControl
Rasika
Asked On July 14, 2015 02:01 AM

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

Senthil Kumaran Rajan [Syncfusion]
Replied On July 15, 2015 09:06 AM

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


Rasika
Replied On July 17, 2015 01:37 AM

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


Senthil Kumaran Rajan [Syncfusion]
Replied On July 17, 2015 08:43 AM

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


Rasika
Replied On July 18, 2015 02:17 AM

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

Senthil Kumaran Rajan [Syncfusion]
Replied On July 20, 2015 08:48 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;