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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Diagram: Unable to clear diagram

Thread ID:

Created:

Updated:

Platform:

Replies:

112396 Sep 20,2013 12:38 AM UTC Sep 23,2013 11:44 AM UTC WinRT 3
loading
Tags: SfDiagram
Garry Mc
Asked On September 20, 2013 12:38 AM UTC

Greetings

I want to replace an existing diagram with a new one based on a new dataset. I'm able to eliminate the nodes, but the connectors remain which confuses the new diagram. I want to know how I can clear out the diagram ready for a new set of data. I've tried the following so far:

   Connectors = new Connector[] { };

   Nodes = new Node[] { };

Also tried setting to null and also tried calling:

   LayoutManager.Layout.UpdateLayout();

However none of this worked, it only clears out the nodes not the connectors. I'm currently running v.11.3.0.30.

Thanks
Garry Mc


Ramya Thirugnanam [Syncfusion]
Replied On September 20, 2013 07:25 AM UTC

Hi Garry,

Sorry about the inconvenience caused.

The reported issue “Connectors Collection does not update visually while reassigning with another collection” is confirmed as a defect and we have logged an issue report to fix this. This fix will be available in our upcoming WinRT service pack release.

Workaround:
 
Instead of using array, please use ObservableCollection<T> for populating the Nodes and Connector properties of SfDiagram.it will resolve the issue with clearing Connector Collection by using Clear () method before assigning new set of data.

We have created a simple sample to represent this workaround. Please refer to the sample from the attachment.

Please let us know if you need any further assistance.
Regards,
Ramya



112396_3f8dc6c3.zip

Garry Mc
Replied On September 20, 2013 05:23 PM UTC

Thanks for the prompt turn around!! The workaround has solved my issue, so many thanks!


SideNote

I have found that the documentation for the Diagram control is somewhat lacking. As an example, I see there's a ViewModel option however I don't see ANY documentation on how its to be used. The control has a lot of potential but with the lack of documentation its hard to take advantage of.



Ramya Thirugnanam [Syncfusion]
Replied On September 23, 2013 11:44 AM UTC

Hi Garry,

Thank you for the feedback.

We have a set of ViewModel classes, but these are classes just implemented from corresponding interfaces (Example: NodeViewModel implemented INode). Except for INotifyPropertyChanged, these classes do not have any logic/implementation. These are just utility classes, just to reduce the time/work of creating a new one in application side for customers.

All kind of objects Views (Node), ViewModels (NodeViewModel), Interfaces (INode) have the same set of properties, so it is not necessary to explain separately for each kind.

A detailed explanation about adding and rendering a UI and Non-UI element and explained in the below link. Here we have explained how to use ViewModel and how corresponding views are created, and how can you override with custom views. Please refer to the link.

Link: http://help.syncfusion.com/UG/winrt/Documents/rendering.htm

Please let us know if you need any further assistance.
Regards,
Ramya


CONFIRMATION

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.

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

;