# XTR.EXPANDLEVEL > [HTML Version](xtr_expandlevel.htm) This field allows you to control the expanded/collapsed state of the items when the tree is created or re-entered. Set the field to a value between 0 and 63, indicating the maximum level to expand (0=all items collapsed so that only the level 0 items are visible, 63=all items expanded). You may optionally specify one of the two flags listed below: | **Symbol** | **Value** | **Description** | |------|------|------| | XTEXPF\_SAVE | \&h40 | Save current expand/collapse status on exit | | XTEXPF\_RESTORE | \&h80 | Restore saved status (on XTROP\_REPLACE reentry) | **Notes** XTEXPF\_SAVE can be used with any of the level values (0-63) in XTR.EXPANDLEVEL to start out with the specified uniform level of expansion but save the user-modified status on exit. But XTEXPF\_RESTORE overrides all other options unless there was no previously saved status, in which case XTEXPF\_RESTORE is ignored. XTEXPF\_RESTORE assumes that the order of the rows has not changed since the previous exit from that tree. Since the expand/collapse status is associated only with the row numbers as displayed, changing the sort order on reentry would result in the wrong items being expanded or collapsed. **See Also** • [Expand/Collapse State](expandcollapsestate.htm.md) **History** 2023 August, A-Shell 1737: Increase maximum number of multi-level trees from nine to 63.