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

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

1 Answer 19 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ralph
Top achievements
Rank 1
Ralph asked on 12 Aug 2011, 06:28 PM
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?

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 17 Aug 2011, 08:11 AM
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 >>

Tags
TreeView
Asked by
Ralph
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or