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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Databinding SfDiagram

Thread ID:

Created:

Updated:

Platform:

Replies:

114241 Nov 7,2013 03:07 PM UTC Apr 24,2018 06:27 AM UTC WinRT 3
loading
Tags: SfDiagram
Colin Desmond
Asked On November 7, 2013 03:07 PM UTC

We're using the Syncfusion Controls for WinRt and we're trying to build up the nodes/connectors for an SfDiagram programatically in a ViewModel. We're also using Prism to bind it all together.

Our ViewModel exposes an SfDiagram property and we're binding like this

<syncfusion:SfDiagram Tool="None" Grid.Row="1" DataContext="{Binding InvestigationDiagram}" Nodes="{Binding Nodes}" Connectors="{Binding Connectors}" >

Yet this is not working. I am seeing the following binding errors

Error: Converter failed to convert value of type 'System.Collections.ObjectModel.ObservableCollection1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' to type 'IIterable1<Object>'; BindingExpression: Path='Nodes' DataItem='Syncfusion.UI.Xaml.Diagram.SelectorViewModel, Syncfusion.SfDiagram.WinRT, Version=11.3010.0.30, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89'; target element is 'Syncfusion.UI.Xaml.Diagram.Selector' (Name='null'); target property is 'Nodes' (type 'IIterable1').

[Above error or a variation 6 times]

Error: Converter failed to convert value of type 'System.Collections.ObjectModel.ObservableCollection1[[Syncfusion.UI.Xaml.Diagram.Node, Syncfusion.SfDiagram.WinRT, Version=11.3010.0.30, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]], System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' to type 'IIterable1'; BindingExpression: Path='Nodes' DataItem='Syncfusion.UI.Xaml.Diagram.SfDiagram'; target element is 'Syncfusion.UI.Xaml.Diagram.SfDiagram' (Name='null'); target property is 'Nodes' (type 'IIterable1<Object>'). Error: Converter failed to convert value of type 'System.Collections.ObjectModel.ObservableCollection1[[Syncfusion.UI.Xaml.Diagram.Connector, Syncfusion.SfDiagram.WinRT, Version=11.3010.0.30, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]], System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' to type 'IIterable1<Object>'; BindingExpression: Path='Connectors' DataItem='Syncfusion.UI.Xaml.Diagram.SfDiagram'; target element is 'Syncfusion.UI.Xaml.Diagram.SfDiagram' (Name='null'); target property is 'Connectors' (type 'IIterable1'). `

We have also tried to bind the LayoutManager but got similar issues.

I now assume we're simply going about this the wrong way.

So, how do we build some data in a ViewModel and then bind to an SfDiagram?


Ramya Thirugnanam [Syncfusion]
Replied On November 8, 2013 11:38 AM UTC

Hi Colin,

We are able to reproduce the reported issue” binding errors” with SfDiagram. It seems to be framework problem. However, we have provided a sample with workaround to resolve this issue. Please refer to the sample from the attachment.

Sample Details:

The same type of properties throws binding errors in binding. To avoid this binding error, we have created the dummy properties in View with type used in Viewmodel for Nodes and Connectors Properties. And also we have added one more property with type of “object” in view to resolve the binding error from SelectorViewModel in the provided sample.

[c#]

public ObservableCollection<object> dummy3 { get; set; }


Please let us know if you have any questions about this.
Regards,
Ramya



114241_3e29101d.zip

Srikanth
Replied On April 23, 2018 11:23 AM UTC

Hi Team,

Looks like url of the above sample is broken.

Can you please provide the url ? 

Thanks,
Sri.

Karkuvel Rajan Shanmugavel [Syncfusion]
Replied On April 24, 2018 06:27 AM UTC

Hi Srikanth, 
 
This issue is applicable only in our older version, we have addressed this issue our recent release. We have changed SfDiagram.Node property from type ‘IEnumerable<Object>’ to type ‘Object’. Hence, this binding error will no more appear.  If this issue is still reproduced please provide sample, code snippet, console error so that we can check and provide you a solution. 
 
Regards, 
Karkuvel Rajan.S  
 


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

;