Hi Deepa,
This definitely works but there seems to be several "side effects" that are not desireable.
It seems that the BeforeNodePaint event is being called over and over when the tree is in the current view. Also, a node''s helptext is not being shown when it is set (verified text was not empty in debugger).
Is there no way to change a node''s text''s color when I create the tree without using the BeforeNodePaint event?
Thanks,
Rich
>Hi Rich,
>
>You could programatically change the color of a single node''s text by handling treeViewAdv1_BeforeNodePaint Event along with setting OwnerDrawNodes property to true .
>
>Coding:
>
>this.treeViewAdv1.OwnerDrawNodes = true;
>
>private void treeViewAdv1_BeforeNodePaint(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvPaintEventArgs e)
>{
>if(e.Node.Text.ToString()=="Node0")
>{
>e.Node.TextColor=Color.Red;
>}
>if(e.Node.Text.ToString()=="Node1")
>{
>e.Node.TextColor=Color.Blue;
>}
>else if(e.Node.Text.ToString()=="Node2")
>{
>e.Node.TextColor=Color.GreenYellow;
>}
>else if(e.Node.Text.ToString()=="Node3")
>{
>e.Node.TextColor=Color.Aqua;
>}
>else if(e.Node.Text.ToString()=="Node4")
>{
>e.Node.TextColor=Color.Violet;
>}
>else if(e.Node.Text.ToString()=="Node5")
>{
>e.Node.TextColor=Color.Chocolate;
>}
>}
>
>Please take a look at the attached sample and let me know if this helps you.
>
>Thanks for your continued interest in Syncfusion products.
>
>Regards,
>
>Deepa.T.S
>
ColorOfNode''sText.zip