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

GraphSource changes issue

1 Answer 110 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Alvise
Top achievements
Rank 1
Alvise asked on 13 Mar 2017, 01:28 PM
Hi,

i'm facing an issue with RadDiagram in WPF.
I'm using the diagram in MVVM by using the GraphSource in order to populate it. 
I'm using your OrgChart project as sample to develop my application.
The app works perfectly the first time i startup it and the RadDiagram is populated correctly.
But whenever i try to modify the GraphSource (via "PopulateGraphSource" method as you use in OrgChart project) and then i layout my diagram, i get not all shapes displayed correctly on screen. I mean: the diagram route is correct, but some shapes are wrong and some others are not displayed.
I do not understand the issue, because it happens even if i populate the GraphSource with the same data that i use at startup time (At startup it works, at a second time it doesn't work, with same data).
The issue happens only when i call the "PopulateGraphSource" a second time. If i just call the Layout method of the diagram without calling "PopulateGraphSource", everything works correctly. But i need to change my GraphSource during the execution of the application.

The question has already been asked by another user but i guess he has exactly my issue at this link: http://www.telerik.com/forums/dynamically-change-graphsource-through-populategraphsource-method
Thank you in advance for your help.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 14 Mar 2017, 01:50 PM
Hello Alvise,

I already answered your question in ticket with ID 1097287. Here is some information from the thread which could be helpful if someone else hit a similar issue.

Such issues appear if the link view model is associated with node view models before the node is added in the graph source. To resolve them you can make sure that the nodes are added in the graph source before the links that connects them.

Regards,
Martin
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Diagram
Asked by
Alvise
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or