# Expand/Collapse State

> [HTML Version](expandcollapsestate.htm)

_Added April 2013_

_cformat_ code:  **= **(equals sign)

This option is used for maintaining the expand/collapse state of items in a multi-level tree. When loading data items (XTROP\_CREATE or XTROP\_REPLACE), the column values will be processed as follows:

| **Value** | **Action** |
|------|------|
| " " (blank) | No special action |
| 0 | Force item to be collapsed |
| 1 | Force item to be expanded (immediate dependents displayed) |
| "A" | Same as "1" but expand out all dependents of the item |




Normally you would want to hide this column by adding **H** to the _cformat_ code.

To retrieve the current expand/collapse state of the items on exit from the tree, you add the **U** code (e.g. =**HU**) to make the column editable by the application so that the corresponding column of the answer array will be updated on return from the tree. This also means that item expand states will be potentially updated when re-entering the tree in XTROP\_RESELECT mode. Note that in this case, you must use XTF2\_ANSEQDATA flag (the answer and data arrays must be the same format, or perhaps even the same array).

**History**

2013 April, A-Shell 6.1.1348:  Added to A-Shell

