Populating the RadDiagram with large amount of shapes

2 posts, 0 answers
  1. Igor
    Igor avatar
    4 posts
    Member since:
    Nov 2010

    Posted 05 Oct 2014 Link to this post

    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?

  2. Zarko
    Zarko avatar
    755 posts

    Posted 07 Oct 2014 Link to this post

    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.


    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.

Back to Top