Thank you for the description.
Let me start with that RadDiagram supports UI virtualization
. This means that only the elements in the visible area of the diagram (the viewport) will be displayed in the visual tree, thus improving the performance when it comes to interactions with the control (pan, zoom, etc.). But, the virtualization kicks in after the diagram elements are loaded initially and their containers are generated. Probably this is the reason why the diagram is slower when loading the first items, which I guess are in larger amount than the items added subsequently.
However, when the diagram thumbnail is included there is a peculiarity which you should keep in mind. The thumbnail shows the diagram shapes with images which are created with the BitmapUtils.CreateWriteableBitmap() method. The method is called many times because the thumbnail control listens for changes in the visual children of the diagram. Each time an item is added in the diagram, the thumbnail stops the UI virtualization and makes a snapshot (and image) of all diagram elements. Then it enables the virtualization again. In a scenario with many elements this is quite slow operation. You can improve the performance by using the approach that you mentioned in point the question from your reply marked as 1. Basically, when you start adding new items in the diagram you can set the IsAutoRefreshEnabled property of the thumbnail to false
. This will prevent it from updating, and therefore creating new images. After the items are added you can call the RefreshThumbnail() method which will create snapshots of the diagram items and display them in the thumbnail.
I hope this information is useful.
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer
and share your thoughts.