We are trying to construct a File Explorer type of experience for browsing a file structure that is stored in our database. I explored the RadFileExplorer and found that, while it's tree view was good, the file view side would not show a radgrid with customizable/filterable columns without a whole lot of work, so I'm constructing our file explorer by using a RadTreeView and a RadGrid instead.
Due to the size of the file structure, I decided to use the RadTreeView's LoadOnDemand. I'm currently using ExpandMode=WebService, since I have to go back to the database for the "values" of the nodes and use my business objects to populate the "text" -- but I don't want to have to deal with the overhead of a postback.
I load the root of the file structure during TreeView_Load:
This is working great when I want to start my file explorer in the root node. However, there are cases in my app when I want to start in a subdirectory. (For example: Files/Folder/SubFolder)
I would like to expand the "Files" node (and populate it's children), the "Folder" node (and populate it's children), and select the "SubFolder" node (so that it fires the SelectedIndexChanged event, which populates the RadGrid). I don't know at design time how deep into the tree I'll need to load, but I will know the entire path (both by Text and by Value) by the time I need to populate the tree in OnLoad.
Is this possible with WebService expand? If so, how can I do it? I've tried just setting Node.Expand=true, but that doesn't seem to populate all the children.
--Christina
Due to the size of the file structure, I decided to use the RadTreeView's LoadOnDemand. I'm currently using ExpandMode=WebService, since I have to go back to the database for the "values" of the nodes and use my business objects to populate the "text" -- but I don't want to have to deal with the overhead of a postback.
I load the root of the file structure during TreeView_Load:
if
(!
this
.IsPostBack)
{
tvFolders.Nodes.Add(
new
RadTreeNode(
"Files"
,
"1"
){ExpandMode = TreeNodeExpandMode.WebService});
}
This is working great when I want to start my file explorer in the root node. However, there are cases in my app when I want to start in a subdirectory. (For example: Files/Folder/SubFolder)
I would like to expand the "Files" node (and populate it's children), the "Folder" node (and populate it's children), and select the "SubFolder" node (so that it fires the SelectedIndexChanged event, which populates the RadGrid). I don't know at design time how deep into the tree I'll need to load, but I will know the entire path (both by Text and by Value) by the time I need to populate the tree in OnLoad.
Is this possible with WebService expand? If so, how can I do it? I've tried just setting Node.Expand=true, but that doesn't seem to populate all the children.
--Christina