I must create a tree structure from scratch on my MVC VIEW page. This is for a folder tree within my web page. What I need to know is how to create a dynamic table that indents based on the data level - I will need a table that print out as shown in the example based on the Level. Bind Data in a Tree List is the final goal.
How do I create a for loop or some type of loop that will allow me to loop through my data-set and structure the content as presented below?
Example:
Tree | Level | Type (Folder or File) |
My Documents | Level 0 | Folder |
Saved By The Bell.docx | Level 1 | File |
Hank Shizzoe | Level 1 | Folder |
Lord of the Files | Level 1 | Folder |
Folder 103 | Level 2 | Folder |
Folder 104 | Level 2 | Folder |
Count_Excel.xls | Level 3 | File |
New History | Level 0 | Folder |
Favorite Authors | Level 0 | Folder |
John Steinbeck | Level 1 | Folder |
Essay 1.doc | Level 2 | File |
Essay 2.doc | Level 2 | File |
Your expertise is greatly appreciated.