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. Image for the cookie policy date
close icon

Two way binding?

I am wondering if TwoWay binding works for charts ItemSource? I think I've done everything as it should be, but with no success.

XAML:
ItemsSource="{Binding dataList, Mode=TwoWay}"

CS:
private void dragEnd(object sender, Syncfusion.UI.Xaml.Charts.ChartDragEndEventArgs e)
{
        Debug.WriteLine(((listOfCharts)((ObservableDictionary)this.DataContext)["Item"]).dataList[1].NoOfUsers);
}

So after dragging is complete dragEnd method writes me in debuger the same value as it was before...not changed one.
Am I doing something wrong here?

7 Replies

KV Karthikeyan V Syncfusion Team February 19, 2014 04:19 AM UTC

Hi Klemen,

 

Thank you for using Syncfusion products.

 

We have analysed the reported requirement. You can change the underlying collection in drag and drop with series or segments. But we need to set the UpdateSource property as True in series.

 

Code snippet [XAML]:

 

<chart:LineSeries Label="Sports" ItemsSource="{Binding CategoricalDatas}"  UpdateSource=”True”

                    XBindingPath="Category" YBindingPath="Value"

                    EnableSeriesDragging="True"/>

 

Please let us know if you require further assistance on this.

 

Thanks,

Karthikeyan V.

 



KO Klemen Ošlaj replied to Karthikeyan V February 20, 2014 01:56 PM UTC

Hi Klemen,

 

Thank you for using Syncfusion products.

 

We have analysed the reported requirement. You can change the underlying collection in drag and drop with series or segments. But we need to set the UpdateSource property as True in series.

 

Code snippet [XAML]:

 

<chart:LineSeries Label="Sports" ItemsSource="{Binding CategoricalDatas}"  UpdateSource=”True”

                    XBindingPath="Category" YBindingPath="Value"

                    EnableSeriesDragging="True"/>

 

Please let us know if you require further assistance on this.

 

Thanks,

Karthikeyan V.

 


Yes, it works now, thanks.
I would like to ask you another question.

What this error means: "Error: BindingExpression path error: 'StrokeDashArray' property not found on 'Syncfusion.UI.Xaml.Charts.ColumnSeries'."
Everything working as expected, but I still get this error.


KO Klemen Ošlaj February 20, 2014 07:39 PM UTC

and one other thing, which event can I use, when I, for an example, drag charts column(other interactions also) and wish new value to appear in debugger. DragEnd doesn't seems to work properly, because when I check for changed value there, it shows me an old one, not updated.


KV Karthikeyan V Syncfusion Team February 21, 2014 01:21 PM UTC

Hi Klemen,

Thanks for the update.

We have analysed the reported requirement. We have prepared a sample that tries to meet your requirement and the same can be downloaded from the below link.

Note: We have planned to change the behaviour of drag and drop event in our upcoming volume 1 release, which will resolve your issue.

Please let us know if you require further assistance on this.

Thanks,

Karthikeyan V.


Attachment: DragAndDropWinRT_f0f8b23f.zip


KV Karthikeyan V Syncfusion Team February 21, 2014 06:29 PM UTC

Hi Klemen,

Please ignore the previously uploaded sample.

Query: BindingExpression path error

We are already fixed these issues. The fix for this issue is estimated to be available on our upcoming volume 1 release 2014.

Thanks,

Karthikeyan V.


Attachment: DragAndDropWinRT_ede9332c.zip


KO Klemen Ošlaj February 24, 2014 12:40 PM UTC

Hi Karthikeyan V.

Thanks for this solution.
I found one that also works, but I dare to aks of you, to check if it is good enough,

private void dragEnd(object sender, Syncfusion.UI.Xaml.Charts.ChartDragEndEventArgs e)
{
      this.DragEnd = true;
}

private void pointerReleased(object sender, PointerRoutedEventArgs e)
{
     if (this.DragEnd)
     {
           chartHolder.DataContext = null;
           chartHolder.DataContext = ((listOfCharts)defaultViewModel["Item"]);
           this.DragEnd = false;
     }
}


KV Karthikeyan V Syncfusion Team February 26, 2014 07:38 AM UTC

Hi Klemen,

 

Thanks for the update.

 

We analysed your suggested solution and it could be used to meet your requirement. Please let us know if you require further assistance on this.

 

Thanks,

Karthikeyan V.


Loader.
Live Chat Icon For mobile
Up arrow icon