RadCartesianChart databinding

3 posts, 0 answers
  1. Aaron
    Aaron avatar
    17 posts
    Member since:
    Jan 2011

    Posted 29 Jul 2013 Link to this post

    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:


    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. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 02 Aug 2013 Link to this post

    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?

    Petar Kirov
    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 >>
  3. Aaron
    Aaron avatar
    17 posts
    Member since:
    Jan 2011

    Posted 05 Aug 2013 Link to this post

    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?
Back to Top