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.

Databinding Complex Itemssource

Thread ID:

Created:

Updated:

Platform:

Replies:

124057 May 11,2016 04:45 PM May 19,2016 10:39 AM UWP 5
loading
Tags: SfChart
MD
Asked On May 11, 2016 04:45 PM

Hello,

I'm trying to bind a complex datasource to a line series chart without any luck.

The itemssource is structured as follows:

Root
|
-CollectedValues-values[]
|
...
|
-TimeStamp-timestamps[]
|
...

My XAML looks like this:

<chart:LineSeries XBindingPath="CollectedValues.values"
	          YBindingPath="TimeStamp.timeStamps"
ItemsSource
="{Binding MyDataPath}">
The chart remains empty (the itemssource has the desired content available) and the following error gets logged:

Error: Converter failed to convert value of type 'MyApp.Models.Data+Root, MyApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' to type 'IBindableIterable'; BindingExpression: Path='MyDataPath' DataItem='MyApp.ViewModels.MainPageViewModel'; target element is 'Syncfusion.UI.Xaml.Charts.LineSeries' (Name='null'); target property is 'ItemsSource' (type 'IBindableIterable').

How do I properly bind the chart to my itemssource?

Many thanks in advance!

Samuel Rajadurai Edwin Rajamanickam [Syncfusion]
Replied On May 12, 2016 01:46 PM

Hi Marco,

Thanks for contacting Syncfusion Support.

We analyzed your requirement of binding complex data source and prepared samples in "Complex Binding" and "Array Binding". Please find the attached samples from the link below.

Complex Binding: Complex_Binding_Prop
Array Binding: Complex_Binding_Array

For more information please refer the following UG link: 
  
Please let us know if you have any queries.

Regards,
Samuel

 


MD
Replied On May 13, 2016 01:33 AM

Thanks for the samples but it ain't working the error still occurs with my itemssource.

Error: Converter failed to convert value of type 'MyApp.Models.Data+Root, MyApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' to type 'IBindableIterable'; BindingExpression: Path='MyDataPath' DataItem='MyApp.ViewModels.MainPageViewModel'; target element is 'Syncfusion.UI.Xaml.Charts.LineSeries' (Name='null'); target property is 'ItemsSource' (type 'IBindableIterable').

Samuel Rajadurai Edwin Rajamanickam [Syncfusion]
Replied On May 14, 2016 06:06 AM

Hi Marco,

Thanks for the update.

We have modified the complex binding sample to achieve your requirement. Please find the sample from the link below.
Complex_Binding_ProArr 

If this doesn’t satisfy your requirement, please provide us a sample with the use case of your scenario, it would be more helpful for us to provide you the solution. 

Regards,
Samuel


MD
Replied On May 18, 2016 06:25 AM

This didn't work either. It seems that the control can't handle nested itemssources. I've made a new nested list in a fresh app and the same error occured.

I worked around it by making a flat itemssource.

Thanks anyway.

Samuel Rajadurai Edwin Rajamanickam [Syncfusion]
Replied On May 19, 2016 10:39 AM

Hi Marco,

Thanks for the update.

SfChart having provision to bind complex properties in chart series. IEnumerable types (Array, IList etc.,) can be bind only in the ItemsSource property and in XBindingPath and YBindingPath properties, we can bind only primitive datatype properties.

Regards,
Samuel 


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.

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.

;