Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4155
How to use a trigger to display different image for Node based on if Node is expanded or not?
posted

How can i display one image if the node is expanded, and another if it is not expanded?  I can't seem to figure out the trigger for this...  I already have a DataTemplate started:

<igDT:NodeLayout Key="ReportFolder" TargetTypeName="ReportFolder" DisplayMemberPath="FolderName" >
                                            <igDT:NodeLayout.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel Orientation="Horizontal" >
                                                        <Image Source="/Resources/Icons/closed_folder.png" /> //this needs to be open_folder.png when IsExpanded=true
                                                        <TextBlock Text="{Binding Data.FolderName}"/>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </igDT:NodeLayout.ItemTemplate>
                                        </igDT:NodeLayout>
Parents
No Data
Reply
  • 34810
    Verified Answer
    Offline posted

    Hello Travis,

    Rather than defining a NodeLayout.ItemTemplate, I would recommend that you look into the ExpandedIconTemplate and CollapsedIconTemplate values of the XamDataTree. If you set these to a DataTemplate with an Image inside, they will change accordingly.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Developer Support Engineer I
    Infragistics Inc.
    www.infragistics.com/support

Children
No Data