The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi, 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.
NANikhil A Syncfusion Team 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); tree.RefreshLayout();
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.
Regards, Nikhil.
RRRon RaisJune 17, 2009 07:26 AM UTC
Hi, Thanks a lot, works perfectly.
JFJames FosterJune 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?
NANikhil A Syncfusion Team 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 .