Problem with 2 RadChart

2 posts, 0 answers
  1. Federico
    Federico avatar
    1 posts
    Member since:
    May 2012

    Posted 29 May 2012 Link to this post


    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"









          d:DesignHeight="500" d:DesignWidth="700">

    Grid x:Name="myGrid" ShowGridLines="False" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Height="300">


         <RowDefinition Height="150" />

         <RowDefinition Height="150" />



         <ColumnDefinition Width="*" />


    <telerikChart:RadChart x:Name="firstRadChart" BorderThickness="0" 
    ="Transparent" VerticalAlignment="Top"
         ItemsSource="{Binding myDataSource}" 
        Padding="0" Grid.Column="0" Grid.Row="0"

          Height="150" Width="640" 
    ="Center" Background="Transparent" >


    <telerikChart:RadChart x:Name="secondRadChart" BorderThickness="0" 
    ="Transparent" VerticalAlignment="Top" 
    ="{Binding myDataSource}"
        Padding="0" Grid.Column="0" Grid.Row="1" 
        Height="150" Width="700" 
    ="Transparent" Foreground="Transparent">




    Thanks a lot to everyone who help me!


  2. Rosko
    Rosko avatar
    137 posts

    Posted 01 Jun 2012 Link to this post

    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.

    the Telerik team

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

Back to Top