TreeView Node Expansion

Advertisement

InteXX
Joined:
Posts:
29
Location:
Fairbanks, Alaska

TreeView Node Expansion

Hello

I'm not handy in C/C++, otherwise I'd consider volunteering to work on this myself. Maybe someone else can have a look? It's possible the TreeView code is too deeply embedded to make it easy to pull this off, but I'll propose it in any case.

I've done this in the past with my FoxPro code and it's worked pretty well.

When Explorer View's TreeView loads a node, the node's expand event can be modified slightly to include a load all of its grandchildren. This way a node's expansion control (the plus/minus symbol) will always immediately indicate whether or not it has children, even before we expand it.

Currently the model is that we have to select a node in order to determine whether it has children. This makes navigating the heirarchy a guessing game, which can become frustrating at times.

Some example psuedo code:
BeginEvent NodeExpand(ThisNode)
  ForEach ChildNode In ThisNode.Children
    If ChildNode.HasChildren = False
      ChildNode.LoadChildren()
    EndIf
  EndFor
EndEvent

Would such a change be possible to implement?

Thanks,
Jeff Bowman
www.intexx.com

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: TreeView Node Expansion

I know. But loading child-nodes from remote server is expensive. If you have slow line, it can take minutes.

Reply with quote

InteXX
Joined:
Posts:
29
Location:
Fairbanks, Alaska

Re: TreeView Node Expansion

Ah, I smell a user option coming on ;-)

TreeView loading behavior:
  • Load grandchildren on node expand
  • Load children and expand node on selection
And/Or, even better yet:

TreeView node expansion:
  • Synchronous loading
  • Asynchronous loading
This way the user can choose for himself, instead of us choosing for him :-)

Thanks,
Jeff Bowman
www.intexx.com

Reply with quote

martin
Site Admin
martin avatar

Re: TreeView Node Expansion

Asynchronous loading is definitely the solution. Though it is too much work, providing the feature is not that demanded. Will see if more people asks for that.

Reply with quote

Advertisement

You can post new topics in this forum