Explorer style n-level deep TreeView using WCF onLoadDemand

2 posts, 0 answers
  1. Christian Muggli
    Christian Muggli avatar
    7 posts
    Member since:
    Jul 2009

    Posted 30 Apr 2010 Link to this post

    Good day

    i've already read:

    What i need to achieve is, a RadTreeView which is filled by a WCF Service, using the LoadOnDemand Event. I really learned a lot from the mentioned above articles, but still there is one thing i do not understand. Think of Windows Explorer Style TreeView. Which Elements do i need to accomplish a similiar Solution / Style? i mean, some use a ValueConverter, some a HierarchicalDataTemplate other use just a DataTemplate. What i have is an ObservableCollection<ContentData> which has a Property of ObservableCollection<ContentDataList>
    The Class

        public class ContentData  
            public ContentData()  
                Id = 0;  
                Guid = string.Empty;  
                ArhPath = string.Empty;  
                Date = new DateTime();  
                ImageIndex = 0;  
                MaskId = 0;  
                Name = string.Empty;  
                ParentId = 0;  
                Type = 0;  
                XDate = new DateTime();  
                MaskData=new MaskData();  
                Accessdata=new AccessData();  
                ContentDataList = new List<ContentData>();  

    here i'm filling the Collection on the Server-side

    contentData = contentDataList.Where(ContentData => ContentData.Id.Equals(parentFolder.Id)).First(); 

    Silverlight code:

           public ViewArchiveTreeControl()  
                if (!Globals.IsDesignTime)  
                    Loaded += ArchiveTreeControl_Loaded;  
            void ArchiveTreeControl_Loaded(object sender, RoutedEventArgs e)  
                Session.WcfClient.GetContentDataCompleted += PlanArchivServiceClientGetContentDataCompleted;  
                Session.WcfClient.GetContentDataAsync("1", FOLDERSEARCHTYPE.RootFolder);  
            void PlanArchivServiceClientGetContentDataCompleted(object sender, GetContentDataCompletedEventArgs e)  
                if (e.Error != null || e.Result == nullreturn;  
    // to be implemented  

    in the AsyncCompleted Event i tried various things like binding the the ItemsSource (code behind and declaratively in xaml). but i'm getting stuck when it comes to the part where i need to tell the RadTreeViewControl about it's parent-childern relative.. Did one of you guys something similiar? could you shed a light? do i need to use a ValueConverter or a HierarchicalDataTemplate or something else?

    help's really appreciated!

  2. Ivan
    Ivan avatar
    519 posts

    Posted 06 May 2010 Link to this post

    Hi Christian,

    We are sorry for the late response.

    We prepared a simple application that loads (on demand) a simplified folder-tree structure. Each folder contains a list of files. The folder tree is displayed in the RadTreeView control at left side. If you select a tree-item (i.e. a folder) all its files will be shown in the items control at right-side. To populate the Folder-tree please click on the button at top of the application.

    Please give it a try and let us know if you have other question.

    Sincerely yours,
    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