Occasional VS 2010 compiler error that I cannot create an instance of RadTreeView

2 posts, 0 answers
  1. Ralph
    Ralph avatar
    8 posts
    Member since:
    Mar 2011

    Posted 12 Aug 2011 Link to this post

    Error 2 Cannot create an instance of "TreeView". C:\tfs\GenOn\MyControls.Controls\MyControls.Controls.xxxInformation\xxxInform.xaml 29 13 MyControls.Controls.xxxInformation

        x:Class="MyControls.Controls.xxxInform"
        xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" xmlns:telerikgrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
        xmlns:my1="clr-namespace:MyControls.Controls;assembly=MyControls.Controls.TreeView"
        xmlns:my3="clr-namespace:Telerik.Windows.QuickStart.Animation;assembly=Telerik.Windows.QuickStart"
                 xmlns:ViewModels="clr-namespace:MyControls.Controls.ViewModels"
        xmlns:Globalization="clr-namespace:System.Globalization;assembly=mscorlib" mc:Ignorable="d"
           <Grid x:Name="LayoutRoot" Background="White"
            <Grid.ColumnDefinitions
                <ColumnDefinition Width="250"></ColumnDefinition
                <ColumnDefinition Width="5"></ColumnDefinition
                <ColumnDefinition Width="710"></ColumnDefinition
                <ColumnDefinition Width="700"></ColumnDefinition
            </Grid.ColumnDefinitions
            <Grid.RowDefinitions
                <!--<RowDefinition Height="5"></RowDefinition>-->
                <RowDefinition Height="530"></RowDefinition
                <RowDefinition Height="530"></RowDefinition
            </Grid.RowDefinitions
            <Border  BorderBrush="Black"  BorderThickness="2"
                <my1:TreeView x:Name="trvTreeView" Margin="0,5,0,0"/> 
            </Border
    <!-- Further details elided -->
    The line <my1:TreeView x"Name="trvTreeView" Margin="0,5,0,0" /> is where the error occurs. Sometimes I can fix this by Rebuild All. Sometimes I have to delete generated code. Is there a way to fix this for good? Is it a bug in Visual Studio?
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 17 Aug 2011 Link to this post

    Hi Ralph,

     This could be a name-related problem since the tree in the Silverlight Framework is also named "TreeView".
    Could you please try to rename your tree to something different from RadTreeView and TreeView and let us know if this helps?

    Best wishes,
    Petar Mladenov
    the Telerik team

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

  3. DevCraft banner
Back to Top