Errors when trying to bind RadTreeView to CollectionViewSource with a ViewModel source

2 posts, 0 answers
  1. Mariano
    Mariano avatar
    8 posts
    Member since:
    Aug 2010

    Posted 05 Oct 2010 Link to this post

    I´m working on an app with the following architecture, I´m using CSLA .NET 4, BXF for plumbing to MVVM and WPF.

    Files code follow:

    <UserControl x:Class="MyAppDesktopWPF.TreeviewView"       
            d:DesignHeight="300" d:DesignWidth="400"


    CollectionViewSource x:Key="TreeAreaDS" Source="{Binding
    Source={StaticResource TrashViewModel},

    HierarchicalDataTemplate x:Key="ToolsDataTemplate"ItemsSource="{Binding Tools}" >
                <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/>

            <HierarchicalDataTemplate x:Key="SegmentsDataTemplate"
    ItemsSource="{Binding Segments}" ItemTemplate="{StaticResource ToolsDataTemplate}" >
                <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/>

            <HierarchicalDataTemplate  x:Key="SectionsDataTemplate" 
    ItemsSource="{Binding Sections}" ItemTemplate="{StaticResource
                <TextBlock Text="{Binding Path=Name}"


    <Telerik:RadTreeView ItemsSource="{Binding Source={StaticResource
    TreeAreaDS}}" ItemTemplate="{StaticResource SectionsDataTemplate}"
    Name="PlanTreeView" Height="250" HorizontalAlignment="Left" Margin="3"
    VerticalAlignment="Center" Width="150" />

    public class TrashViewModel : ViewModel<MyAppBO.MyClass>
            public TrashViewModel()
                Bxf.Shell.Instance.ShowStatus(new Bxf.Status { Text =
    "Getting Plan", IsBusy = true });
                ManageObjectLifetime = true;
                // cascade model changed events through VM to View
                Model.PropertyChanged += (o, e) =>

            public TrashViewModel(MyClass classInstance)
                Bxf.Shell.Instance.ShowStatus(new Bxf.Status { Text =
    "Getting Plan", IsBusy = true });
                ManageObjectLifetime = true;
                Model = classInstance;

                // cascade model changed events through VM to View<br>
                Model.PropertyChanged += (o, e) =>

    With this version of the code I get an exception that says:
    "'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.' Line number '108' and line position '50'."
    However if I change the code for the collectionviewsource to:
      <CollectionViewSource x:Key="TreeAreaDS"

    I get this:
    Locating source for 'c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs'. Checksum: MD5 {d5 92 43 67 7f ad 5a 42 93 7e b9 53 ee b2 ef 99}
    The file 'c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs' does not exist.
    Looking in script documents for 'c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs'...
    Looking in the projects for 'c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs'.
    The file was not found in a project.
    Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\'...
    Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
    Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
    Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
    The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs.
    The debugger could not locate the source file 'c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs'.

    Any ideas?
    I could try setting up a demo project, but I´d expose too much of the BL of the app and my employer wouldn´t like that..

  2. Alex Fidanov
    Alex Fidanov avatar
    636 posts

    Posted 07 Oct 2010 Link to this post

    Hi Mariano,

    I tested this but I was not able to reproduce this exception. Please find the attached project which I used to reproduce this issue based on the code you have provided. If possible, please modify it so that the issue becomes reproducible and send it back so that we can look into it.

    All the best,
    Alex Fidanov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top