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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding diagram to dynamic data

Thread ID:





82551 Jun 16,2009 05:14 AM UTC Jun 29,2009 02:49 PM UTC WPF 4
Tags: Diagram
Ron Rais
Asked On June 16, 2009 05:14 AM UTC

I wanted to ask: Is it possible to bind the diagram to dynamic data through the itemsource property, so that when the data changes the diagram autmaticly displays those changes?

I try to change the data object that is assigned to the diagrams datasource property but no changes appear on the screen.


Nikhil A [Syncfusion]
Replied On June 16, 2009 12:56 PM UTC

Hi Ron,

Thanks for your interest in Syncfusion products.

Yes it is possible to change the data using the ItemsSource property. But once the new data is assigned, the tree needs to be refreshed. This can be done using the RefreshLayout method. The following code can be used to refresh the layout:

diagramModel.ItemsSource = dataobj;
DirectedTreeLayout tree = new DirectedTreeLayout(diagramModel, diagramView);

So once you have assigned your data object, then call the RefreshLayout() method of the corresponding tree-layout you are using(in the example I have used DirectedTreeLayout). This should make your changes get reflected.

Please let us know if you have any concerns.


Ron Rais
Replied On June 17, 2009 07:26 AM UTC

Thanks a lot, works perfectly.

James Foster
Replied On June 26, 2009 03:27 PM UTC

Is there any way the diagram can pick up on the fact that it's bound to an observable collection, and automatically refresh whenever the underlying model data changes?

Nikhil A [Syncfusion]
Replied On June 29, 2009 02:49 PM UTC

Hi James,

As mentioned in the previous post, the RefreshLayout() method has to be called when the data changes. Currently, Diagram WPF does not support refreshing the layout by itself . However we will consider providing this support in future releases based on the code compatibility, complexity and product design .



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon