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

        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:Globalization="clr-namespace:System.Globalization;assembly=mscorlib" mc:Ignorable="d"
           <Grid x:Name="LayoutRoot" Background="White"
                <ColumnDefinition Width="250"></ColumnDefinition
                <ColumnDefinition Width="5"></ColumnDefinition
                <ColumnDefinition Width="710"></ColumnDefinition
                <ColumnDefinition Width="700"></ColumnDefinition
                <!--<RowDefinition Height="5"></RowDefinition>-->
                <RowDefinition Height="530"></RowDefinition
                <RowDefinition Height="530"></RowDefinition
            <Border  BorderBrush="Black"  BorderThickness="2"
                <my1:TreeView x:Name="trvTreeView" Margin="0,5,0,0"/> 
    <!-- 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
    Petar Mladenov avatar
    3162 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 >>

Back to Top