I'm a beginner in Silverlight, so I have difficult using RadChart.
I made a Control with 2 Chart; running Debug, the project work fine, but when I open the control in design mode, I get the error "NullReferenceException: Object reference not set to an instance of an object" on the second chart, so I can visualize correctly the first Chart but not the second one.
If I delete one of two RadChart, I have no error.
There is no difference if I delete the first one or the second one, or if I commute position placing the second one (secondRadChart) on the top and the other (firstRadChart) on the bottom: with one single chart I have no error, with two chart I get error on the one placed below.
I also tried to place both Chart in different StackPanel or in different Grid, but with no success.
This is a great problem for me: because of this error i can't open in design mode all page containing this control.
This is my XAML file:
<UserControl x:Class="MyProject.MyControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converter="clr-namespace:MyProject"
xmlns:telerikChart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
xmlns:chart="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="700">
<Grid x:Name="myGrid" ShowGridLines="False" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Height="300">
<Grid.RowDefinitions>
<RowDefinition Height="150" />
<RowDefinition Height="150" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<telerikChart:RadChart x:Name="firstRadChart" BorderThickness="0"
BorderBrush="Transparent" VerticalAlignment="Top"
ItemsSource="{Binding myDataSource}"
Padding="0" Grid.Column="0" Grid.Row="0"
Height="150" Width="640"
HorizontalAlignment="Center" Background="Transparent" >
</telerikChart:RadChart>
<telerikChart:RadChart x:Name="secondRadChart" BorderThickness="0"
BorderBrush="Transparent" VerticalAlignment="Top"
ItemsSource="{Binding myDataSource}"
Padding="0" Grid.Column="0" Grid.Row="1"
Height="150" Width="700"
Background="Transparent" Foreground="Transparent">
</telerikChart:RadChart>
</Grid>
</UserControl>
Thanks a lot to everyone who help me!
Federico