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

[Solved] Multi level treeView

0 Answers 113 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shaza
Top achievements
Rank 1
Shaza asked on 21 Apr 2011, 09:54 AM
I'm working on binding three levels to my telerik treeView

   
+Directories
 
      *Archives
 
         -Documents
 
      *Directories



This is my code:

<% Html.Telerik().TreeView()
          .Name("TeleTreeView")
          .DragAndDrop(true)
          .ExpandAll(true)
           .BindTo(Model, mappings =>
             {
                 mappings.For<SARS.Directory>(binding => binding
                         .ItemDataBound((item, directory) =>
                         {
                             item.Text = (string)directory.DirectoryName;
                             item.Value = (string)directory.NodeID;
                             item.ImagUrl="~/Images/Folder-Add-icon.png";
                         })
                        
                          
                         //Sub Directories
                         .Children(directory => directory.Directory1));
                         mappings.For<SARS.Directory>(binding => binding
                         .ItemDataBound((item, dir) =>
                         {
                             item.Text = dir.DirectoryName;
                             item.Value = (string)dir.NodeID;
                             item.ImagUrl="~/Images/Folder-Add-icon.png";
                         })
                       
                         //Sub archives
                         1-  .Children(directory => directory.Archives));
                           mappings.For<SARS.Archive>(binding => binding
                           .ItemDataBound((item, arch) =>
                           {
                               item.Text = arch.ArchiveName;
                            }));
                  
       })
             .Render();%>


The problem is that I'm not getting the Archives level (1-)!!
What should I do?
Tags
TreeView
Asked by
Shaza
Top achievements
Rank 1
Share this question
or