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
430
Alternate Row Color in Wintree
posted

Hi,

I am using a ultraTree and want to displa alternate rows having different back colors.I am not able to find the property for it as it present in Ultragrid Override.RowAlternateAppearance.BackColor,

Override.RowAlternateAppearance.BackColor2

Please suggest me to how to achive this.

regards,

ravi

  • 69832
    Verified Answer
    Offline posted

    Infragistics.Win.Appearance evenAppearance = new Infragistics.Win.Appearance();
    Infragistics.Win.Appearance oddAppearance = new Infragistics.Win.Appearance();
    evenAppearance.BackColor = Color.LightBlue;
    oddAppearance.BackColor = Color.LightYellow;

    UltraTreeNode[ nodes = new UltraTreeNode[100];
    for ( int i = 0; i < 100; i ++ )
    {
        UltraTreeNode node = new UltraTreeNode( null, string.Format("Node {0}", i) );
        nodesIdea = node;

        node.Override.NodeAppearance =  (i % 2) == 0 ? evenAppearance : oddAppearance;               
    }

    this.ultraTree1.Nodes.AddRange( nodes );