This is a migrated thread and some comments may be shown as answers.

RadCartesianChart databinding

2 Answers 129 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 29 Jul 2013, 06:07 PM
Hello, I have a simple question, here's what I want to do:

 <telerik:RadCartesianChart Grid.Row="1"   DataContext="{Binding Chart}" Grid.Column="0" Grid.ColumnSpan="2"></telerik:RadCartesianChart>

I want to be able to bind a RadCartesianChart to a RadCartesianChart object in my view model, do I have to use a different attribute than the one above.  I can get it to work using a holder StackPanel then calling doing this:

chartHolder.Children.Add

But I'd rather just directly manipulate the Chart object and have it directly interact with the chart rather than removing the chart, regenerating it, then adding it back to the holder.

Is this possible?

2 Answers, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 02 Aug 2013, 08:10 AM
Hi Aaron,

You can use RadCartesianChart in MVVM scenarios like any other WPF control - you can bind the properties of the control that you want to change to corresponding properties in your ViewModel.
When you want to change some of the RadCartesianChart's settings, instead of recreating the control from scratch, you can just adjust the properties in your ViewModel. Adjusting them will update the corresponding properties in RadCartesianChart. For more complex scenarios you can use SeriesProvider feature. Here you can learn more about it.

Is this what you are looking for?

Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Aaron
Top achievements
Rank 1
answered on 05 Aug 2013, 03:00 PM
That is sort of what I'm looking for, but it's not working.  All I want to do is add the WPF for telerik:RadCartesianChart and then have that object in the viewmodel to bind do.  It doesn't work when I do what I described in my first post.  What am I missing?
Tags
ChartView
Asked by
Aaron
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or