ShowAsTree - Expanded

mihail_kolevmihail_kolev Member Posts: 379
edited 2012-08-14 in NAV Three Tier
Hello,

I'm making a treeview (Repeater -> ShowAsTree) of some data. The only problem i have is that the treeview is always collapsed by default. Is there any way to show the tree Expanded by default or expand it after data is loaded by some code? Thank you for any suggestions.
-Mihail- [MCTS]

Answers

  • Rob_HansenRob_Hansen Member Posts: 296
    Did you come up with a solution to this? I have the same requirement to manipulate the expanded/collapsed states.
  • mihail_kolevmihail_kolev Member Posts: 379
    not yet :(
    -Mihail- [MCTS]
  • beranberan Member, Microsoft Employee Posts: 80
    Have you looked at page Chart of Accounts Overview (634). In the AL function

    OnPageAll it says

    IF ISSERVICETIER THEN
    ExpandAll
    ELSE
    InitTempTable;

    Does that solve your problem?
    Eric Beran
    Software Design Engineer II
    Dynamics NAV Office 365
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • beranberan Member, Microsoft Employee Posts: 80
    Sorry that just build the rows in depth. The view is still collapsed (underneith it is in fact fully expanded but there is a view on top of that - that is collapsed). There is only the runtime functionality that can expand all and collapse all.
    Eric Beran
    Software Design Engineer II
    Dynamics NAV Office 365
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • deV.chdeV.ch Member Posts: 543
    hmm that's weird, i have a page with treeview too, but mine is allways expanded when i open it :-k

    But for handling by code, you could try to do it with sendkeys. The expand/collapse toggle is ctrl+shift+Q
  • mihail_kolevmihail_kolev Member Posts: 379
    what type is the page, how you run the page...?
    -Mihail- [MCTS]
  • deV.chdeV.ch Member Posts: 543
    it's a ListPlus and i run it by code : Page.Run()
  • ecriss15ecriss15 Member Posts: 14
    Have anyone managed to resolve this problem ?
    I have a similar situation, I want to modify Page 6520 Item Tracing so when to user hits button Trace the results will be shown in Expand All. It works in Classic Client but in RTC the code for Expand All, Collapse All is not available.
  • deV.chdeV.ch Member Posts: 543
    SendKeys ;)
  • ecriss15ecriss15 Member Posts: 14
    deV.ch wrote:
    SendKeys ;)
    Thank you for answering so quickly.
    I thought about SendKeys but seems complicated since the shortcut Ctrl + Shift + Q is only for one line not for expand All. I didn't see any shortcut for Expand All. If I use this shortcut I would have to move from main page, after pushing Trace button, to the first line an then to all the other lines. I don't know if this is even possible, I must admit I'm quite new with pages.
  • beranberan Member, Microsoft Employee Posts: 80
    I noted this small issue in our books. When it comes out to the market is a good question?
    Eric Beran
    Software Design Engineer II
    Dynamics NAV Office 365
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • derkbernhardtderkbernhardt Member Posts: 2
    Hi!

    We tried a long time, but finally we found a workaround for it!
    Add this code to the OnOpenPage()-Trigger. The variable WshShell is an automation of the type "Windows Script Host Object Model.WshShell".

    IF (ISCLEAR(WshShell)) THEN BEGIN
    CREATE(WshShell, FALSE, TRUE);
    END;
    WshShell.SendKeys('+{F10}E{ENTER}');
    // menu key + E + Enter
    CLEAR(WshShell);

    Note:
    The keys to send depends on the language. This is working for ENU.

    Derk
  • mihail_kolevmihail_kolev Member Posts: 379
    wow, nice tip :thumbsup: this could be useful not only for expanding a tree view. Thanks for sharing

    EDIT: the topic is now [solved] :)
    -Mihail- [MCTS]
  • mgmmgm Member Posts: 126
    works fine =D>
    as long as the filter pane is not visible :-k
Sign In or Register to comment.