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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

UI hangs for ~30 Seconds after drag and drop from Syncfusion TreeView to SyncFusion SfDiagram control

Thread ID:

Created:

Updated:

Platform:

Replies:

148716 Oct 30,2019 06:59 PM UTC Jul 14,2020 05:21 AM UTC WPF 20
loading
Tags: TreeViewAdv
John
Asked On October 30, 2019 06:59 PM UTC

I'm attempting to drag a business object from a SyncFusion TreeView control to a SyncFusion SfDiagram control, but the UI is unresponsive for approximately 30 seconds after the drop completes.  The object appears properly in the SfDiagram control.  The process is essentially this:

  1. The treeview control has objects with the Tag property set to the business object.
  2. The Drag operation takes the reference to the business object, creates the DataObject using the business object in the constructor, then invokes the DoDragDrop method.
  3. On the receiving end, the SfDiagram unpacks the business object and performs a web-service call to populate additional data for the NodeViewModel used in the diagram.  The Webservice call completes quickly without errors and the Object appears in the diagram successfully.  Unfortunately, the UI hangs for approximately 30 seconds.

Things I've tried:

  • Invoking the drop code explicitly on the UI thread
  • Invoking the drop code asynchronously on a separate thread

The relevant code is shown below.

Drag drop initiation code in TreeView control

      private Point _startPoint;
        private void SfTvObjects_PreviewMouseMove(object sender, MouseEventArgs e)
        {
           
            if (e.LeftButton == MouseButtonState.Pressed )
            {
                
                var mousePos = e.GetPosition(null);
                var diff = _startPoint - mousePos;
                if ( Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance
                || Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance)
                {
                    Debug.WriteLine("EmbeddedObjectBrowser::SfTvObjects_PreviewMouseMove invoked - Initiating drag and drop");
                    var tv = sender as TreeViewAdv;
                   
                    var selItem = (TreeViewItemAdv)tv.SelectedItem;
                    if (selItem == null)
                    {
                        return//  Weird behavior sometimes causes this to happen.  Safe to ignore
                    }
                    IGHARemoteObject gObj = (IGHARemoteObject)selItem.Tag;

                    var dragData = new DataObject(gObj);
                    try
                    {
                        DragDrop.DoDragDrop(tv, dragData, DragDropEffects.Copy);
                    }
                    catch (Exception ex)
                    {

                        Debug.WriteLine("EmbeddedObjectBrowser::SfTvObjects_PreviewMouseMove exception thrown.  Ignoring. " + ex.Message);
                    }
                    

                }
            }

"Drop" code used by the SfDiagram control

 private bool _dropInProgress = false;
        private void SfDiagVisualFlow_Drop(object sender, DragEventArgs e)
        {
            Debug.WriteLine("VfEditor::SfDiagVisualFlow_Drop executed");
            if (_dropInProgress)
            {
                Debug.WriteLine("VfEditor::SfDiagVisualFlow_Drop previous drop already in progress, ignoring this one");
                return;  //  To deal with the multiple drop issue with WPF
            }
            _dropInProgress = true;
            var data = e.Data;
            var formats = data.GetFormats();
            
           
            switch (formats[0])
            {
                case "RemoteLib.GHARemoteObject":
                    GHARemoteObject dropObj = data.GetData(formats[0]) as GHARemoteObject;
                    VfGHAObjectViewModel node = new VfGHAObjectViewModel(dropObj);
                    ((NodeCollection)sfDiagVisualFlow.Nodes).Add(node);
                    break;
                default:
                    break;
            }

            _dropInProgress = false;
        }

Any help you can provide would be appreciated.

Vijayalakshmi Roopkumar [Syncfusion]
Replied On October 31, 2019 01:41 PM UTC

Hi John, 
 
Thanks for contacting Syncfusion Support. 
 
We have already planned to do the performance improvement in TreeViewAdv control and it will be completed in our upcoming release. We will consider the reported case and update you once we have completed the implementation.

 
You can track the status of this feature through the following feedback link,   
 
 
We appreciate your patience until then. 
 
Regards, 
Vijayalakshmi V.R. 
 


John
Replied On October 31, 2019 01:45 PM UTC

Am I experiencing a known issue?


Vijayalakshmi Roopkumar [Syncfusion]
Replied On November 1, 2019 04:32 PM UTC

Hi John, 

Thank you for the update. 

Yes, it's a known issue and we are currently working on it to improve performance, but it has some difficulties as it involves changing TreeViewAdv architecture. So we are currently looking at an alternative way to implement this. 

Regards 
Vijayalakshmi V.R. 


Steve Naidamast
Replied On June 22, 2020 08:18 PM UTC

Hi Vijayalakshmi...

I am using your Treeview component in several places in my WPF application.

I noticed what may be a similar issue with responsiveness as has been noted here.

In my case I have two major pages; Download and Upload, both of which display your Treeview component is a panel on the left side of my display with loaded data. The loaded data always appears to be correct.  However, after I upload a document in the Upload form and then go to the Download form to ensure that the data has been correctly inserted into my database, the Treeview in the Download form seems to hang for around 20 or 30 seconds or so and then displays the corresponding data from the selected node.

In my Upload page I actually have two Treeview components (the second being used to display in in-page file explorer interface).  On the Download page I have a Treeview and just a standard Datagrid component (non-Syncfusion).

Could I be running into some type of conflict that is causing my Treeview to hang in the Download page after uploading a document in my Upload page and then selecting the menu option to display the Download page?

I have been running quite a few tests on this issue and have yet to find anything wrong with all the code involved...

Thank you...

Steve Naidamast
Sr. Software Engineer

Niranjan Kumar Gopalan [Syncfusion]
Replied On June 23, 2020 12:24 PM UTC

Hi Steve, 

Thanks for your update. 

We have checked your query “The TreeViewAdv control hangs for 10 to 20 seconds when upload the data in Database ”and this is due to the processing time for the TreeViewAdv to update the data to the Database and reflect the same, especially if the data is large. Please let us know if your query has been resolved. 

Regards, 
Niranjan Kumar 



Steve Naidamast
Replied On June 26, 2020 10:50 PM UTC

Niranjan...

Thank you for replying to my query so quickly... :-)

The issue I am having appears to be with the Syncfusion Treeview component on my DocumentsDownload page when this WPF page is requested after DocumentsUpload page has been used where there are 2 Syncfusion Treeview components.

I have gone through every aspect of the code I could see as relating to the issue and for quite a while I thought  it was the standard WPF Datagrid on the DocumentsDownload page.  However, after further testing it appears that it is the Syncfusion Treeview component that is causing my application to hang until some internal processing of the Treeview has been completed.

I have attached a document to demonstrate the sequence of events in a visual format.

Steve Naidamast
Sr. Software Engineer

Attachment: IssueDocument_SyncfusionTreeviewComponent_a656be04.zip

Niranjan Kumar Gopalan [Syncfusion]
Replied On June 30, 2020 12:47 PM UTC

Hi Steve, 

Thanks for your update. 

We think this delay of layout update is due to loading of the uploaded documents to each tree node when DocumentDownload page is opened. Can you please let us know whether you are using SfTreeview or TreeViewAdv ? If using TreeViewAdv can you try SfTreeView please let us know about the performance. Otherwise if you can provide a simple sample in which reported issue can be reproduced , we will analyze and share you the details. 

Regards, 
Niranjan Kumar Gopalan  


Steve Naidamast
Replied On July 2, 2020 04:03 PM UTC

Niranjan...

Thank you for your reply...

As to your first question, I am using the following Treeview component from Syncfusion's WPF component tool-set in my DownloadDocuments page.

    syncfusion:TreeViewAdv

As to your suggestion that the additional delay that I am experiencing with the intiial display of the DownloadDocuments page is a result of the loading of the document records in the background,  this is not correct.

No document records are loaded into the right-most data-grid until a node in the tree-view, hierarchical, display has been selected.  As a result, this should not be an issue.

I did look for the alternative tree-view component that you recommended but it does not appear in my Syncfusion WPF component list in my toolbox.  "sfTreeMap" is the only one I have found...

>>> Update
In further testing this morning (7/2/2020), I have noticed this issue has appeared in other pages where I use the Syncfusion TreeViewAdv component.

I am beginning to believe that this is an issue with the internals of this component and not anything in my code.
<<<

Thank you...

Steve Naidamast
Sr. Software Engineer





Niranjan Kumar Gopalan [Syncfusion]
Replied On July 3, 2020 12:13 PM UTC

Hi Steve, 

Thanks for your update. 

Currently we are analyzing the mentioned query “ TreeViewAdv when loads data from DataBase takes long seconds to update the layout” and we will update you the details on July 7, 2020. We appreciate your patience until then. 

Regards, 
Niranjan Kumar Gopalan  


Steve Naidamast
Replied On July 3, 2020 02:49 PM UTC

Niranjan...

Thank you for taking the time to review the issue I have added to this thread.

Steve Naidamast
Sr. Software Engineer


Niranjan Kumar Gopalan [Syncfusion]
Replied On July 6, 2020 04:50 AM UTC

Hi Steve, 

Thanks for your update. 

As promised we will update you the analyzed details tomorrow (July 7, 2020). We appreciate your patience until then. 

Regards, 
Niranjan Kumar Gopalan 


Niranjan Kumar Gopalan [Syncfusion]
Replied On July 7, 2020 11:18 AM UTC

Hi Steve,  
 
Sorry for the inconvenience caused. 
 
 Due to some complexities faced while analyzing we will update you the details on July 9, 2020. We appreciate your patience until then.  
 
Regards,  
Niranjan Kumar Gopalan  
 


Steve Naidamast
Replied On July 7, 2020 01:16 PM UTC

Hi Niranjan...

Thank you again for your update on my issue.

Steve Naidamast
Sr. Software Engineer

Niranjan Kumar Gopalan [Syncfusion]
Replied On July 8, 2020 05:58 AM UTC

Hi Steve, 

Thanks for your patience. 

We have checked the reported query “TreeView when loaded with MS SQL Database takes few seconds to load in layout of application” and we are able to reproduce it. We have created a simple sample in which the TreeViewAdv is loaded with Database containing few data and when load the TreeVIewAdv control on menu item click as you have done in your application it took the following time to update in layout. 

S.No 
Controls  
Time to load (seconds) 
Ms TreeView 
2.26 
TreeViewAdv 
2.32 
SfTreeView( available in version 18.2) 
2.22 
  
Please refer the below sample in which we have tested the performance of TreeViewAdv and can you please use the MS TreeView control in your application and let us know if it took long to load the same database on same scenario? It will be helpful for us to proceed further. 


Regards, 
Niranjan Kumar Gopalan 


Steve Naidamast
Replied On July 9, 2020 10:14 PM UTC

Hi Niranjan...

Thank you for taking the time to analyze the issue I have been facing with the TreeViewAdv component.

However, I am not sure if your test was extensive enough.  In my situation, if I go directly to the WPF page where the TreeView is having issues, it loads quickly and efficiently in its fully expanded state.

Now I leave this page and go to another page in my application, do some work, and then come back to the TreeView page.  Now the TreeView component hangs for close to 30 seconds.  And this happens on any page that has the TreeViewAdv component on it.

I have done quite a bit of research to determine exactly what is causing this timing issue and at first I thought it was the Datagrid that is part of the same page.  However, I was able to demonstrate to myself that the Datagrid did not appear to be the problem leaving me with the TreeView component since it is the only other major component on this particular page.

I have also reviewed my code for such other areas that could be causing such a bottleneck on the pages other than where this situation occurs and have not been able to find anything out of the ordinary.

This situation definitely feels like something is going on internally and out of my code's control but I have no idea what it could be.  However, again, it always appears on the pages with the TreeViewAdv component.

Nonetheless, I will test my application with a standard .NET WPF TreeView component as you suggested and provide my results to you.

Thank you...

Steve Naidamast
Sr. Software Engineer

Niranjan Kumar Gopalan [Syncfusion]
Replied On July 10, 2020 10:29 AM UTC

Hi Steve, 

Thanks for your update. 

We have checked the reported query in same scenario i.e. when after loading the page with TreeViewAdv binded with DataBase and working in another page and reverting back to the previous page with TreeViewAdv and  but we are unable to reproduce the issue. Please refer the below attached sample for same , otherwise can you please modify the sample and share it back to us. We will be waiting to hear from you after using the MS TreeView control. 


Regards, 
Niranjan Kumar Gopalan 


Steve Naidamast
Replied On July 11, 2020 09:12 PM UTC

Hi Niranjan...

As you suggested, I implemented the standard, Microsoft WPF Treeview control in place of the corresponding Syncfusion control.  It took a bit of time to get all of the code aligned properly with the substitute Treeview but it went in fairly easily.

Upon testing my DownloadDocuments page with the Microsoft Treeview control, I found absolutely no issues with its response to my somewhat complex loading processe and there was never any delay that I noticed.  The only thing that did not work was the mouse-button event I had set up against the Syncfusion Treeview.  However, this probably required some additional tinkering with the code, which I did not want to touch.  And in any event, this process had nothing to do with the delays I have been experiencing.

I also reviewed your sample code and it too did not exhibit any issues that I noticed.  As a result, the issue may be with the way I am loading my Treeview data but I would think that if this were the case, the Microsoft Treeview would have exhibited similar issues, which as I just mentioned, it didn't.

At this point I have to conclude that I am triggering something in the Syncfusion Treeview that is causing it to hang after the load process has been completed.  Is it possibly a parameter I need to set?  I have tried several in the course of my testing but nothing seemed to make a difference.

If you would like me to post my XAML page and the corresponding code, please let me know.

Thank you for your continuing assistance in this matter...

Steve Naidamast
Sr. Software Engineer

Niranjan Kumar Gopalan [Syncfusion]
Replied On July 13, 2020 02:07 AM UTC

Hi Steve, 

Thanks for your update. 

We have tried to reproduce the issue in the mentioned scenario with TreeViewAdv with the previously provided sample, but unable to reproduce the exact issue. Can you please modify the provided sample to reproduce the issue and revert it back to us or send a sample that can reproduce your issue, it will be really helpful for us to proceed further and provide solution as early as possible. 

Regards, 
Niranjan Kumar Gopalan 


Steve Naidamast
Replied On July 13, 2020 02:14 PM UTC

Hi Niranjan...

Updating your provided, sample project would be far too complex given the amount of database and TreeViewAdv processes that are involved.

I could send you the code files for both the DocumentUpload and the DocumentDownload WPF pages so you could review how I have implemented the TreeViewAdv in both cases.

Steve Naidamast
Sr. Software Engineer

Niranjan Kumar Gopalan [Syncfusion]
Replied On July 14, 2020 05:21 AM UTC

Hi Steve, 
 
Thanks for your update. 
 
We have created a new incident under your Direct trac account . We suggest you to follow up with the incident for further updates. Please log in using the below link. 
https://www.syncfusion.com/account/login
 
 
Regards, 
Niranjan Kumar Gopalan 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon