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
410
DataSource based styling of webdatatree nodes
posted

I need to style each node of the tree differently based on the data it is bound to.  Ultimately, it's really just changing the color of the text so I am not changing much.  I am binding it to a datatable and one of the columns could be the "CSS name" , "color" , or like.  Can this be done automatically during binding or is this something I have to iterate through the nodes to do?

  • 8160
    posted

    Hello bobkrug,

    you could handle WebDataTree1_NodeBound and then check for some condition and apply css for the particular node:

     

        protected void WebDataTree1_NodeBound(object sender, DataTreeNodeEventArgs e)

        {

            //Check if the value of the node is equal to 10

            if (e.Node.Value == "10")

            {

                e.Node.CssClass = "active";

            }       

        }

    Check this post
    http://forums.infragistics.com/forums/p/39982/225719.aspx# ,the issue is the same as yours

    Please let me know if you need additional assistance