ccrpminilogo.gif (1886 bytes)  Knowledge Base
 KB Index    FAQ Index    Controls  
  
CCRP FolderTreeview
FOLDERTREEVIEW
Bug: Canceling a Folder Expand Event Causes Folder Reloading

Solution: Error Loading DLL

Fix: PreSelectedFolder Property Fails to Pre-select

Solution: FolderTreeview Properties not Visible; Runtime Error in Visual Basic IDE
   

CONTROL PAGE
FolderTreeview/VB6 Page
FolderTreeview/VB5 Page
   

INDEX
CCRP FAQ Index
CCRP KB Index


   

Bug: Canceling a Folder Expand Event Causes Folder Reloading
Last reviewed July 02, 1999
  
  
The information in this article applies to:

  • CCRP FolderTreeview (FTV) Control Beta 3 build 0.03.0023, VB6 version.
  • All VB5 versions up to, and including: CCRP FolderTreeview (FTV) Control Beta 3 build 0.03.0023
       
Symptom

If the Expand event is cancelled for a folder that has not yet been expanded, when the folder is finally expanded, the FolderTreeview displays duplicate subfolders under that folder.
   

Cause

The FolderTreeview control still loads a folder's subfolders whose Expand event is cancelled, but fails to set an internal flag indicating that the folder's subfolders have been loaded.
   

More Information

When the FolderTreeview's Expand event is cancelled, the FTV correctly loads all the subfolders into the tree under the collapsed parent folder. The parent's subfolders are in the tree, they're just not visible. This functionality is used by the Folder class, and is necessary.

Internally, each time a folder is expanded, the FTV code checks that treeview item's TVIS_EXPANDEDONCE state flag. This flag indicates whether or not the item has been expanded once. If the item has not yet been expanded, the FTV loads the subfolders under that folder item.

When the Expand event is cancelled for a folder that has never been expanded, the TVIS_EXPANDEDONCE flag is not correctly set. As a result, all subfolders under a parent folder can get loaded twice or more.
  

Status

This has been confirmed as a bug and *updated FTV beta 3 control build will be made available on the CCRP site soon.
  

Workaround

Users of the FTV Beta 3 build 0.03.0023 can use the methods in this demo to circumvent the problem. This code will not be necessary in the updated FTV control release.

Download FTVCancelExpandFix.zip (6k)
Contains projects for both VB5 and VB6
 

Fix

Existing users of the FTV Beta 3 build 0.03.0023 should download the newer Version 1 control from the following links:

VB6 FTV Version 1: ccrpftv6-10.zip (279k)
VB5 FTV Version 1: ccrpftv5-10.zip (279k)

 

Brad Martinez
02 July 1999
Copyright
© 1999 Common Controls Replacement Project