AX – D365FO – Auto expand whole tree in FormTreeControl

If you have a Tree control on your form and want to expand the whole tree with all items and subitems at once, you can use the following static method:

SysFormTreeControl::expandTree(FormTreeControl _formTreeControl, TreeItemIdx _treeItemIdx, int _toLevel = 0,int _level = 0 )

For example to expand the whole tree from the root item to the inner most item:

SysFormTreeControl::expandTree(TreeCtrl, TreeCtrl.getRoot());
Or only from the current selection item down the tree:

SysFormTreeControl::expandTree(TreeCtrl, TreeCtrl.getSelection());

This article written by my friend Arun Garg: https://community.dynamics.com/ax/b/dynamicsaxsolutions/posts/auto-expand-whole-tree-in-formtreecontrol

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...