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

Problem with 2 RadChart

1 Answer 80 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Federico
Top achievements
Rank 1
Federico asked on 29 May 2012, 09:48 AM
Hello,

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

1 Answer, 1 is accepted

Sort by
0
Rosko
Telerik team
answered on 01 Jun 2012, 09:48 AM
Hello Darren,

We suspect the error you are observing on your end is a different manifestation of a known Silverlight 5 design-time issue reported here and here (it does not matter whether your actual project uses Silverlight 4 or 5 as long as Silverlight 5 is installed on the workstation). If that is the case we would suggest you to install .NET4.5 Beta and that should resolve the design-time problem -- you can find the download here.

Let me elaborate a bit more why installing version of the full .NET framework fixes Silverlight design time issue -- Silverlight 5 itself (being technology for the Web) does no calls to the full .NET framework but its design-time support (as the one in WPF) does. Also, Silverlight 5 does not install .NET 4.5 and it should not install it -- the problem here is that some Microsoft design-time method calls erroneously rely on .NET 4.5 implementation and resolve properly only when .NET 4.5 is installed.

Regards,
Rosko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Chart
Asked by
Federico
Top achievements
Rank 1
Answers by
Rosko
Telerik team
Share this question
or