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
395
Different icon in WebDataTree when node expanded/collapsed
posted

Hi,

I'm new to Infragistics and i want to use the WebDataTree. I can build the tree and i want to show an icon near each node. This works via NodeSettings. But i want to show a different icon if the node is expanded or collapsed. Like showing an Folder-icon when the node is collapsed and an OpenFolder-icon if it is expanded.

What must i do to achieve that?

Thanks

Martin

Parents
No Data
Reply
  • 49378
    posted

    Hi Martin,

    Thank you for posting in the community.

    In this scenario I can suggest that you enable postback on NodeExpanded and NodeCollapsed. By handling the respective server-side events you can set the ImageUrl or the target node as needed. For instance:

        protected void WebDataTree1_NodeExpanded(object sender, Infragistics.Web.UI.NavigationControls.DataTreeNodeEventArgs e)
        {
            e.Node.ImageUrl = "~/add_disabled.gif";
        }

    Please let me know if this helps.

Children