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

Databound DefaultSeriesDefinition

1 Answer 96 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Tim Robbins
Top achievements
Rank 1
Tim Robbins asked on 08 Jun 2010, 08:46 AM
Hello!

What can one do if the viewModel holds the information wether to display a pie or a bar chart?
Concerning the mvvm pattern I think that this should be the right place - I've tried it like this; perhaps a bit naive:

<telerik:RadChart Name="radChart1" DefaultSeriesDefinition="{Binding MySeriesDef}">
With MySeriesDef a property of type ISeriesDefinition.

But unfortunately this is not working.
How can one achieve this without the need to use code in the View?

A big thanks for any help!!!
Greetings,
Tim.

1 Answer, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 10 Jun 2010, 03:11 PM
Hi Tim Robbins,

The DefaultSeriesDefinition property can not be bound in xaml at present. I would recommend you to use the data binding approach when population your RadChart. Your ViewModel could expose a property of type SeriesMappingCollection containing the series mappings needed(along with their SeriesDefinitions). This property should be bound to the RadChart.SeriesMappings collection.

Hope this will help.

Kind regards,
Velin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Chart
Asked by
Tim Robbins
Top achievements
Rank 1
Answers by
Velin
Telerik team
Share this question
or