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
170
Set backcolor to the child node cells
posted

For an ultraTree with Outlook ViewStyle, iam trying to change the backcolor of cells of a node, but the backcolor only effects to the parent node not the child node.

This is what i am trying to do!

foreach 

 

(var node in ultraTree.Nodes)

{

foreach 

 

(var eachCell in  node.Cells)

{

cell.Appearance.BackColor = Color.Red;

}

}

Please, can you help me, whats going wrong with this?

Thanks

Sami.

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Sami,

    The BackColor only affects the root node because you are only looping through the root nodes.

    The nodes of a tree are in a hierarchical tree structure. So if you want to loop through every node in the tree, you would have to do it recursively. In other words, for each node in your loop, you would have to loop through node.Nodes. And then the child nodes of those nodes, etc.

    If you just want to color all of the cells in a column, though, it's much easier and more efficient to apply an appearance to the column, instead of every individual cell.

Reply Children
No Data