Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Virtual Tree Collapse All
Subject Author Date
Offer Har Mar 12, 2008 - 12:14 PM

Is there a Virtual Tree like the virtual grid?

Offer Har Mar 17, 2008 - 5:35 AM

Thanks.
Will try that out.

Technical Support Mar 17, 2008 - 5:07 AM

Unfortunately the CExtGridWnd-like virtual mode is not supported by tree grids. Although we don’t have such a sample the idea is simple. Insert only one child row into dynamically expandable rows and override the CExtTreeGridWnd::ItemExpand() virtual method which should determine if a tree row has never been expanded and initialize it before invoking the parent class method.

Here is how it can be implemented:
First initialize several top level tree rows. Each of these top level tree rows should be collapsed and has one child row with the Expanding ... text in the first column’s cell. This child row is essential because each top row should have an expand tree box. Implement the ItemExpand() virtual method. This method should detect whether the user is expanding or collapsing a top level row in the tree grid window. In any case, it should remove all the child rows first. Then if the user expands a top level row, the method inserts several data rows and initializes all the cells in the same manner. If the user collapses a top level row, the method inserts one child row with the Expanding ... text in the first column’s cell. So, the tree expand box is always present in top level tree rows, but data rows are available in the tree grid only for expanded top level tree rows.