This is a migrated thread and some comments may be shown as answers.

Populating the RadDiagram with large amount of shapes

1 Answer 132 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 1
Igor asked on 05 Oct 2014, 04:32 PM
Hello,
I fill up the Diagram with Circle shapes which connected between them by RadDiagramConnections.
I use this line of code in order to add shapes from code behind:
diagram.Items.Add(line);  // line is a RadDiagramConnection
There are 1500 connections.
Approximately this action takes 2-3 seconds.
During this action all my GUI is stuck.
Is there something like SuspendLayout while the population process is being in progress?
Could you suggest a solution for this issue?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 07 Oct 2014, 04:42 PM
Hello Igor,
Unfortunately there's no built-in mechanism for layout suspending because only the main(UI) thread can change the layout (add shapes to the visual tree). There's a possible workaround - you could try to add the connections in sets using a dispatcher timer. This way the UI won't be frozen but the actual operation will take more time depending on your interval and set size.
I've attached a sample project demonstrating this approach so could you please examine it and if you have more questions feel free to ask.

Regards,
Zarko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Diagram
Asked by
Igor
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Share this question
or