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

Rad Domain Data Service + TreeListView Binding

4 Answers 73 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Jill
Top achievements
Rank 1
Jill asked on 13 Jan 2011, 11:52 PM
Hi Support,

Can the TreeListView bind to the new RadDomainDataSource control? I ask because I am trying to bind it and all I get is the top tier of items in my collection.

XML looks like this;
<telerik:RadTreeListView x:Name="ActionThreadTreeView" Grid.Row="1" ItemsSource="{Binding DataView, ElementName=ddsCommentActivities}">
 
<telerik:RadTreeListView.ChildTableDefinitions>
  <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
</telerik:RadTreeListView.ChildTableDefinitions>
 
<telerik:RadTreeListView.Columns>
 I define columns here.
</telerik:RadTreeListView.Columns>
 
</telerik:RadTreeListView>

ddsCommentActivities is my RDDS. I'm returning a List<TreeviewHierarchy> which looks like this;
public class TreeviewHierarchy
{
    public TreeviewHierarchy()
    {
        //Create new childrens class so that it's not null.
        Children = new List<TreeviewHierarchy>();
    }
 
    public TreeviewHierarchy( int id, string actName, string actStatusName, string applStatusName, Nullable<System.DateTime> applStatusDate )
    {
        Id = id;
        ActivityName = actName;
        ActivityStatusName = actStatusName;
        ApprovalStatusName = applStatusName;
        ApprovalStatusDateTime = applStatusDate;
 
        //Create new childrens class so that it's not null.
        Children = new List<TreeviewHierarchy>();
    }
 
    [Key]
    public int Id { get; set; }
    public string ActivityName { get; set; }
    public string ActivityStatusName { get; set; }
    public string ApprovalStatusName { get; set; }
    public Nullable<System.DateTime> ApprovalStatusDateTime { get; set; }
    public IList<TreeviewHierarchy> Children { get; set; }
}

I feel this list with data, right now testing four levels deep meaning, one parent->child->child->child. I would think I would see the TreeListView control displaying the data but it only shows the "parent" and no drop down selector. Am I doing something wrong?

Thanks in advance!

4 Answers, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 14 Jan 2011, 09:11 AM
Hello Chris,

After reading this article, can you verify that the child records are actually on the client?

You can remove the RDDS and the TreeListView and simply pull the data with a DomainContext.Load call. You can then debug the object graph in order to see whether the entire hierarchy has been brought to the client.

You can read about this feature here:
We are looking forward to hearing from you.

Kind regards,
Ross
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Jill
Top achievements
Rank 1
answered on 14 Jan 2011, 04:14 PM
Ross,

Thank you for this information. As soon as I can try it I will let you know if it works. Right now adding the attribute tag gives me a visual studio 2010 error;

The type 'System.ComponentModel.DataAnnotations.CompositionAttribute' exists in both 'C:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Server\System.ServiceModel.DomainServices.Server.dll' and 'C:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Silverlight\System.ServiceModel.DomainServices.Client.dll'

I have "using System.ComponentModel.DataAnnotations;" "using System.ServiceModel.DomainServices.Server;" at the top of my code.
0
Jill
Top achievements
Rank 1
answered on 14 Jan 2011, 05:16 PM
Ross,

You were right, the children were not appearing on the client side. I added the [Include] tag and the [Association("","","")] tag and now the children are shown on the client side.

I get the expander now on the first column. It won't show the lines below it but I think there is something I'm not doing right.
0
Jill
Top achievements
Rank 1
answered on 14 Jan 2011, 06:01 PM
Ross,

Expander is working now. I had an issue with my association going off the same column in the parent and child. Not sure why I typed that and not the childs parent Id field name lol!

Anyway thanks for all the help and the quick responses. You guys are great!

Thanks,
Tags
TreeListView
Asked by
Jill
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Jill
Top achievements
Rank 1
Share this question
or