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

Prevent Redirect When Collapse

3 Answers 43 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Laurence
Top achievements
Rank 1
Laurence asked on 11 Jul 2013, 08:22 PM
Hi

I have a radtreeview which is used for a directory structure/file list viewer, and there is a problem when folders are collapsed.

When I have folder (node) A, with subfolder B (child node), if I expand folder A node in the tree and then click on folder B child node, the files are displayed in my content pane correctly. However, once subfolder B node is selected, if I then collapse folder A (parent folder), the tree node collapses correctly, however the content view (list of files) is also refreshed to those contained in the root node. I want to prevent this redirect, and have the content view unchanged (same behaviour as in windows file explorer). I've had a look around and it seems like the OnClientNodeCollapsing is where I need to make the fix, but here I'm only using the default behaviour. And I don't want to disable the collapse itself in the tree, only the redirect in the content.

I'd appreciate any help, thanks

3 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 16 Jul 2013, 07:53 AM
Hi,

I'm not quite sure what default behavior you are refering to. Could you provide a simple example of your code, so that we can have a better understanding of your scenario.
 

Regards,
Bozhidar
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Laurence
Top achievements
Rank 1
answered on 16 Jul 2013, 09:38 AM
Hi Bozhidar,

Yes, sorry I maybe didn't explain it very well.

Let's say I have a treeview with the following structure:

Root Node
(-) Main Directory
(-) sub Directory


If I expand the main directory node and then select the sub directory node, my page then displays a list of files in the sub Directory, in my list view on the right hand side of the page. However, when I select collapse (-) on the Main Directory node, this list view is refreshed, and displays the files in the Root Node directory.

It is my opinion that this refresh should not happen, and my list should still display the contents of the sub Directory. This is the case when you execute the same sequence of actions on a directory structure in windows explorer.

Note, I don't want to disable the collapse action on the node, as the directory tree itself should update (i.e. when Main Directory is collapsed, sub Directory node will be hidden), it's just that the list of files shouldn't be updated.

Hopefully that's clear, thanks
0
Bozhidar
Telerik team
answered on 19 Jul 2013, 05:49 AM
Hello Laurence,

What I meant was for you to send back your code, so that we can see just how exactly you refresh the ListView. By default the RadTreeView doesn't have such extended functionality, it just exposes events. And since the behavior is probably triggered by some custom logic in one of these events, we can't be certain what the issue is without the code itself.
 

Regards,
Bozhidar
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
TreeView
Asked by
Laurence
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Laurence
Top achievements
Rank 1
Share this question
or