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

Question about binding to ChartSeriesProvider.Source ?

1 Answer 72 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Jan Białokozowicz
Top achievements
Rank 1
Jan Białokozowicz asked on 25 Oct 2013, 07:01 AM
In ChartView and PivotGrid integration tutorial\example
(http://www.telerik.com/help/silverlight/radpivotgrid-features-radchartview-integration.html)

you have following xaml piece:

<telerik:RadCartesianChart.SeriesProvider>
    <telerik:ChartSeriesProvider Source="{Binding SeriesSource}" >
        <telerik:ChartSeriesProvider.SeriesDescriptors >
            <telerik:CategoricalSeriesDescriptor  x:Name="seriesDescriptor"  ItemsSourcePath="Items" ValuePath="Value" CategoryPath="NameX"/>
        </telerik:ChartSeriesProvider.SeriesDescriptors>
    </telerik:ChartSeriesProvider>
</telerik:RadCartesianChart.SeriesProvider>

I want to know how to do this line - but without XAML:

<telerik:ChartSeriesProvider Source="{Binding SeriesSource}" >

My concern is ChartSeriesProvider don't have SetBinding method, and i cant do this with RadCartesianChart.
Any help would be great :)

Greetings.

  

1 Answer, 1 is accepted

Sort by
0
Accepted
Milena
Telerik team
answered on 28 Oct 2013, 11:56 AM
Hi Jan,

ChartSeriesProvider doesn't have a SetBinding() method because it inherits directly DependencyObject, instead of FrameworkElement. You can still use data binding, however instead of using the FrameworkElement.SetBinding() instance method you need to use the BindingOperations.SetBinding() static method. Here's an example:

Binding binding = new Binding("SeriesInfos") { Source = viewmodel };
BindingOperations.SetBinding(radCartesianChart1.SeriesProvider, ChartSeriesProvider.SourceProperty, binding);

I hope that this is the solution you are looking for. If it is not - please describe in more details your requirements.

Regards,
Milena
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
Tags
ChartView
Asked by
Jan Białokozowicz
Top achievements
Rank 1
Answers by
Milena
Telerik team
Share this question
or