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.

Adding link then layout causes drawing flicker

Thread ID:

Created:

Updated:

Platform:

Replies:

101503 Oct 29,2011 10:04 AM Oct 31,2011 10:15 AM Windows Forms 2
loading
Tags: Diagram
Johnathan Tunnicliffe
Asked On October 29, 2011 10:04 AM

If I add a link programatically and then perform a layout of the nodes there is a lag in the repositioning of the link head and tail that visibly causes a flicker.

If I take the RadialLayout_2010, remove the call to PopulateNodes() from the constructor, add a new button the form and hook it up to the following code you can observe this:

this.diagram1.BeginUpdate();
this.diagram1.Model.BeginUpdate();
PopulateNodes();
this.diagram1.LayoutManager = new RadialTreeLayoutManager(this.diagram1.Model, 0, 20, 20);
this.diagram1.LayoutManager.UpdateLayout(null);
this.diagram1.UpdateView();
this.diagram1.EndUpdate();
this.diagram1.Model.EndUpdate();

The links get created at point 0,0 -> 0,1 and then get moved as they follow the nodes around from the layout. It doesn't matter that all this is surrounded is surrounded in BeginUpdate and EndUpdate, you get multiple redraws.

Is there a way to avoid this? Perhaps by force updating the position before the view is updated?


Amsath Ali M [Syncfusion]
Replied On October 31, 2011 10:12 AM

Hi Johnathan,

Thanks for using Syncfusion products.

We are able to reproduce the issue reported by you in our end and the issue is due to updating the view the view area of Diagram control. We suggest you to not update the view area of diagram while creating nodes. We have modified the RadialLayout sample to achieve your requirement.

Here is the sample:
CS1274778780.zip

Please try the above sample and let us know if you have any queries.

Regards,
Amsath Ali. M



Amsath Ali M [Syncfusion]
Replied On October 31, 2011 10:15 AM

Hi Johnathan,

Thanks for using Syncfusion products.

We are able to reproduce the issue reported by you in our end and the issue is due to updating the view the view area of Diagram control. We suggest you to not update the view area of diagram while creating nodes. We have modified the RadialLayout sample to achieve your requirement.

Here is the sample:
CS1274778780.zip

Please try the above sample and let us know if you have any queries.

Regards,
Amsath Ali. M



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.

;