By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,023 Members | 1,297 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,023 IT Pros & Developers. It's quick & easy.

Intelligent Directory Tree control

P: n/a
_DS
Problem with mapping a directory tree to a tree control: It takes a
while to recurse subdirs and map them to nodes. This is solved in
some books I've seen (MacDonald, Albahari) by reading the subdir only
when its node on the tree control is opened.

Has anyone pre-packaged this functionality into a control?
Jan 13 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Most 3rd party tree controls for .Net 1.x have support for "Node_Click"
events which support this. If I'm not mistaken, the tree control in .Net 2.0
has this functionality as well.
"_DS" <_D*@noemail.com> wrote in message
news:ih********************************@4ax.com...
Problem with mapping a directory tree to a tree control: It takes a
while to recurse subdirs and map them to nodes. This is solved in
some books I've seen (MacDonald, Albahari) by reading the subdir only
when its node on the tree control is opened.

Has anyone pre-packaged this functionality into a control?

Jan 14 '06 #2

P: n/a
_DS
On Fri, 13 Jan 2006 14:44:42 -0500, _DS <_D*@noemail.com> wrote:
Problem with mapping a directory tree to a tree control: It takes a
while to recurse subdirs and map them to nodes. This is solved in
some books I've seen (MacDonald, Albahari) by reading the subdir only
when its node on the tree control is opened.

Has anyone pre-packaged this functionality into a control?


I appreciate the followup re tree nodes. I did know how to populate
the tree; I've done that before. However, mapping a tree to a
directory structure can get complex, so I was wondering if anyone had
a custom control that handled any of the following:

File system monitor: For updating the tree in the background.
Would help to prevent faults when the file system was changed.

'Just In Time' population of tree nodes: Building the tree from a
large directory structure takes a lot of time. Better to build
it dynamically as nodes are opened. Code for this exists in
the references that I mentioned, but not as an integral part of
a custom control.

Threaded update: This could populate the tree in the background.
After setting up the top level nodes (like 'Just in Time'
above), the thread could work on the other nodes. This could
be combined with the JIT operation, in case the user got ahead
of the background thread by descending into one node before the
thread got there.

Those are just a few that I thought of. Seems like this is a general
purpose kind of control. Does anything like this exist already?
Jan 15 '06 #3

P: n/a
> File system monitor: For updating the tree in the background.
Would help to prevent faults when the file system was changed. Look at threading within the UI. Not sure what you mean by "faults"... When
a file or directory is deleted/added?
Just a thought, but why update until it is needed(see below)?
'Just In Time' population of tree nodes: Building the tree from a
large directory structure takes a lot of time. Better to build
it dynamically as nodes are opened. Code for this exists in
the references that I mentioned, but not as an integral part of
a custom control.
The node_expand/node_click event on most tree controls handle this, though
its not "included", you, the developer needs to control the level of
recursion. If you need to control the depth of expansion, inherit from the
control, add a property, check when its met and you're done. Do you really
want to recurse a directory in the background a user isn't going into?
Windows doesn't.
Threaded update: This could populate the tree in the background.
After setting up the top level nodes (like 'Just in Time'
above), the thread could work on the other nodes. This could
be combined with the JIT operation, in case the user got ahead
of the background thread by descending into one node before the
thread got there.
'Just in Time', as I understand it means 'On Demand', which in end-user
language means 'when I click'. That said, why load more than what the user
is really asking for? Even Windows is 'load on demand', with background
refresh. What is it you're trying to prevent? Changes, Additions, Deletions?
Are you doing anything with the files/directories or just presenting them?

"_DS" <_D*@noemail.com> wrote in message
news:5k********************************@4ax.com... On Fri, 13 Jan 2006 14:44:42 -0500, _DS <_D*@noemail.com> wrote:
Problem with mapping a directory tree to a tree control: It takes a
while to recurse subdirs and map them to nodes. This is solved in
some books I've seen (MacDonald, Albahari) by reading the subdir only
when its node on the tree control is opened.

Has anyone pre-packaged this functionality into a control?


I appreciate the followup re tree nodes. I did know how to populate
the tree; I've done that before. However, mapping a tree to a
directory structure can get complex, so I was wondering if anyone had
a custom control that handled any of the following:

File system monitor: For updating the tree in the background.
Would help to prevent faults when the file system was changed.

'Just In Time' population of tree nodes: Building the tree from a
large directory structure takes a lot of time. Better to build
it dynamically as nodes are opened. Code for this exists in
the references that I mentioned, but not as an integral part of
a custom control.

Threaded update: This could populate the tree in the background.
After setting up the top level nodes (like 'Just in Time'
above), the thread could work on the other nodes. This could
be combined with the JIT operation, in case the user got ahead
of the background thread by descending into one node before the
thread got there.

Those are just a few that I thought of. Seems like this is a general
purpose kind of control. Does anything like this exist already?

Jan 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.