RadTreeListViewItem Datacontext is being set but DataTemplate for Rad Column can't bind to that datacontext being set in xaml

3 posts, 0 answers
  1. Matt
    Matt avatar
    3 posts
    Member since:
    May 2010

    Posted 20 Jun 2010 Link to this post

    Setting a RadTreeListViewItem's DataContext in xaml I can't then get access to that datacontext through <ContentPresenter Content="{Binding Content}" /> or this doesn't work too <ContentPresenter Content="{Binding Path=Content}" />

    Example code below:




    telerik:RadTreeListView x:Name="TreeListViewResults">  



    <telerik:RadColumn Header="Name" Width="150" >












    <ContentPresenter Content="{Binding Path=Content}"></ContentPresenter>




















    <telerik:RadTreeListViewItem x:Name="Testing" IsExpanded="true">








    <l:CompareTreeListViewItem Content="Test" LeftElementName="Test1" RightElementName="Test2"></l:CompareTreeListViewItem>












    CompareTreeListViewItem is just a class with an object Content in it and 2 string properties named LeftElementName and RightElementName.     The result is that the Name columns shows up but the Content "Test" is not showing up under that column. I think this should work. Am I doing anything wrong?






  2. Matt
    Matt avatar
    3 posts
    Member since:
    May 2010

    Posted 23 Jun 2010 Link to this post

    After downloading the silverlight Q2 2010 beta, this question seems to no longer matter. TreeListView has changed quite a bit. I now have a different question in the RadTreeListView.Items   I can't set items in the xaml. Is this on purpose. I don't want to use databinding to set my items, I want to do that through the xaml. There is no RadTreeListViewItem class anymore for the xaml.

  3. Vlad
    Vlad avatar
    11100 posts

    Posted 24 Jun 2010 Link to this post

    Hi Matt,

     Indeed RadTreeListView now is more like RadGridView. Can you post more info about what benefits you expect from declaring items in XAML instead setting ItemsSource?

    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
Back to Top