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

RadChart Not Parsing

3 Answers 27 Views
Chart
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 25 Oct 2012, 08:28 PM

Version 2011.2.712.1040

When InitializeComponent I get an XamlParseException "The type 'RadChart' was not found".  
I have included in this module:
Telerik.Windows.Controls
Telerik.Windows.Controls.Charting
Telerik.Windows.Controls.GirdView

This is using MEF where this RadChart is in a Module view.  I've tried removing the reference then dragging from the tool box to add again, eliminate bindings, using <telerik:RadChart />.  One would think at least an empty control would work.

Your tools shouldn't cause this much trouble.  It has been more than once where I had to reinstall your products and lose days of work troubleshooting problems.  I also imagine Microsoft can be the blame as well.

using System;

using System.Linq;

using System.Windows.Controls;

using System.ComponentModel.Composition;

using SilverlightWithEFDataService.Module.MarketItems.Interfaces;

using SilverlightWithEFDataService.Infrastructure;

namespace SilverlightWithEFDataService.Module.MarketItems.Views

{

    [ViewExport(RegionName = "MainRegion")]

    [PartCreationPolicy(CreationPolicy.NonShared)]

    public partial class MarketItemsView : UserControl

    {

        public MarketItemsView()

        {

            try

            {

                InitializeComponent();

            }

            catch (Exception ex)

            {

                Console.WriteLine(string.Format(@"{0}", ex.InnerException.ToString()));

            }

        }

        [Import]

        public IMarketItemsView ViewModel

        {

            set { this.DataContext = value; }

        }

    }

}
    

<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  

             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  

             x:Class="SilverlightWithEFDataService.Module.MarketItems.Views.MarketItemsView"

             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:viewmodel="clr-namespace:SilverlightWithEFDataService.Module.MarketItems.ViewModels"

             mc:Ignorable="d"

             d:DesignHeight="800" d:DesignWidth="1000" ScrollViewer.VerticalScrollBarVisibility="Visible">

    

    <d:DesignProperties.DataContext>

        <viewmodel:MarketItemsViewModel/>

    </d:DesignProperties.DataContext>

    <Grid>

        <Grid.RowDefinitions>

            <RowDefinition Height="Auto"/>

            <RowDefinition Height="Auto"/>

            <RowDefinition Height="Auto"/>

            <RowDefinition Height="Auto"/>

            <RowDefinition Height="Auto"/>

            <RowDefinition Height="Auto"/>

            <RowDefinition Height="*"/>

        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>

            <ColumnDefinition Width="200"/>

            <ColumnDefinition Width="320"/>

            <ColumnDefinition Width="400"/>

            <ColumnDefinition Width="*"/>

        </Grid.ColumnDefinitions>

        

        <telerik:RadBusyIndicator telerik:StyleManager.Theme="Metro" IsBusy="{Binding SubmitIsBusy}" DisplayAfter="0" Grid.Column="0" Grid.Row="0">

            <StackPanel Margin="3">

                <TextBlock Text="TickerSymbol" HorizontalAlignment="Center"/>

                <TextBox Width="100" HorizontalAlignment="Center" Text="{Binding TickerSymbolName, Mode=TwoWay}"/>

                <TextBlock Text="LastPrice" HorizontalAlignment="Center"/>

                <TextBox Width="100" HorizontalAlignment="Center" Text="{Binding LastPrice, Mode=TwoWay}"/>

                <TextBlock Text="Volume" HorizontalAlignment="Center"/>

                <TextBox Width="100" HorizontalAlignment="Center" Text="{Binding Volume, Mode=TwoWay}"/>

                <telerik:RadButton IsEnabled="{Binding EnableSubmit}" Content="Update Item" Margin="5" Command="{Binding SubmitCommand}" HorizontalAlignment="Center"/>

                <TextBlock Text="{Binding StatusLabel}" Margin="5" VerticalAlignment="Bottom" TextWrapping="Wrap" HorizontalAlignment="Center" Grid.RowSpan="100" Grid.Row="0" Grid.Column="2" />

            </StackPanel>

        </telerik:RadBusyIndicator>

        <telerik:RadBusyIndicator telerik:StyleManager.Theme="Metro" IsBusy="{Binding MarketItemsIsBusy}" DisplayAfter="0" Grid.Column="1" Grid.Row="0" >

            <telerik:RadGridView ItemsSource="{Binding MarketItems}" SelectedItem="{Binding CurrentMarketItem, Mode=TwoWay}" SelectionMode="Single"

                                        AutoGenerateColumns="False" ScrollViewer.VerticalScrollBarVisibility="Visible" MaxHeight="600">

            <telerik:RadGridView.Columns>

                <telerik:GridViewDataColumn Header="TickerSymbol" DataMemberBinding="{Binding TickerSymbol.TickerSymbolName, Mode=TwoWay}" />

                <telerik:GridViewDataColumn Header="LastPrice" DataMemberBinding="{Binding LastPrice, Mode=TwoWay}" />

                <telerik:GridViewDataColumn Header="Volume" DataMemberBinding="{Binding Volume, Mode=TwoWay}" />

            </telerik:RadGridView.Columns>

            </telerik:RadGridView>

        </telerik:RadBusyIndicator>

        <telerik:RadBusyIndicator telerik:StyleManager.Theme="Metro" IsBusy="{Binding HistoryIsBusy}" DisplayAfter="0" Grid.Column="2" Grid.Row="0" >

        <telerik:RadGridView Name="historyView" ItemsSource="{Binding MarketHistoryItems}" AutoGenerateColumns="False"

                             ScrollViewer.VerticalScrollBarVisibility="Visible" MaxHeight="600">

            <telerik:RadGridView.Columns>

                <telerik:GridViewDataColumn Header="TickerSymbol" DataMemberBinding="{Binding MarketItem.TickerSymbol.TickerSymbolName, Mode=TwoWay}" />

                <telerik:GridViewDataColumn Header="CurrentPrice" DataMemberBinding="{Binding CurrentValue, Mode=TwoWay}" />

                <telerik:GridViewDataColumn Header="CurrentDate" DataMemberBinding="{Binding CurrentDate.Date, Mode=TwoWay}" />

            </telerik:RadGridView.Columns>

            </telerik:RadGridView>

        </telerik:RadBusyIndicator>

        

        <telerik:RadChart Grid.Column="4" Grid.Row="0" Grid.ColumnSpan="3" 

                          ItemsSource="{Binding ItemPriceHistory}" />

    </Grid>

</UserControl>


3 Answers, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 29 Oct 2012, 02:03 PM
Hello,

I believe that the  cause of the problem is that your project is targeting Silverlight version 5 and you have referenced Telerik Controls for Silverlight 4 assembly(ies).

Please check and if this is not the cause of the problem do let us know. 
 
Regards,
Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
J
Top achievements
Rank 1
answered on 05 Nov 2012, 07:25 PM
No, I checked everything, each project.  It is targeting Silverlight 4.  .NET 4.0.3
0
J
Top achievements
Rank 1
answered on 05 Nov 2012, 07:46 PM
I found my problem.  I was using mef to use the chart in the main view.  I didn't reference the Charting library in the main view.  Sorry for my confusion.
Tags
Chart
Asked by
J
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
J
Top achievements
Rank 1
Share this question
or