Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

How to add icon to form tree control?

Posted on by 920

Hi,

I add tree control in form:

I want to add icons for this tree :

in the init mey=thod of form I set this code:

 ImageListAppl imageListAppl;

imageListAppl = new ImageListAppl( 32, 32 );

imageListAppl.add(10565);
imageListAppl.add(12265);
imageListAppl.add(10901);
imageListAppl.addOverlay(10565);
imageListAppl.addOverlay(12265);
imageListAppl.addOverlay(10901);

EUKDelegue::buildTree(Tree,imageListAppl.image(10565), name);

But I didn't get any icons

What is the problem?

*This post is locked for comments

  • BASMA Profile Picture
    BASMA 920 on at
    RE: How to add icon to form tree control?

    I created a method buildTree on the table :

    public static void buildTree( FormTreeControl _tree,ImageRes _imageListAppl, str60 _delgueName )

    {

     EUKDelegue         _eukDelegue;

     EUKRoleDelegue     _eukRoleDelegue;

    select DelegueName, RecId

             from _eukDelegue where _eukDelegue.DelegueName==_delgueName;

        select recId from _eukRoleDelegue  where _eukRoleDelegue.DelegueRef == _eukDelegue.RecId;

       _tree.addItem( 0, 0, new FormTreeItem( _eukDelegue.DelegueName,_imageListAppl, _eukRoleDelegue.RecId, _eukDelegue.RecId ) );

    }

    But I didn't get any icone

  • Blue Wang Profile Picture
    Blue Wang on at
    RE: How to add icon to form tree control?

    Hi Basma,

    In Dynamic AX 2012 , we could define an image for a tree node (FormTreeItem) of a tree control (FormTreeControl) on a form.

    Then the image would be displayed as an icon for the tree node.

    Rustem's shared article explains in detail.


    fTreeItem = FormTreeControl.getItem(FormTreeControl.getSelection());

    fTreeItem .Image(1);

    FormTreeControl.setItem(fTreeItem );


    I hope it will help you.

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: How to add icon to form tree control?

    Go through the link from my second suggestion.

  • BASMA Profile Picture
    BASMA 920 on at
    RE: How to add icon to form tree control?

    Hi Rustem.

    Thanks for reply but how can I  define an image goe tree node?

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: How to add icon to form tree control?

    Take a look at this link also:

    community.dynamics.com/.../how-to-use-a-formtreecontrol

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: How to add icon to form tree control?

    Hi BASMA!

    You could define an image for a tree node (FormTreeItem object) of a tree control (FormTreeControl object) on a form. Then the image would be displayed as an icon for the tree node.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans