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

Adding link then layout causes drawing flicker

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?


2 Replies

AA Amsath Ali M Syncfusion Team October 31, 2011 02:12 PM UTC

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




AA Amsath Ali M Syncfusion Team October 31, 2011 02:15 PM UTC

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



Loader.
Live Chat Icon For mobile
Up arrow icon