We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

NodeBackgroundPaint Event Fires Very Frequently

I have a form with 3 TreeviewAdv controls, and I noticed high CPU usage with this form. Upon analysis, it was found that NodeBackgroundPaint is being fired very frequently, even if user is not doing anything (idle state). Can somebody tell me when is this event fired and how to resolve this?
I am using this event to paint the background of the nodes as suggested in the help/documentation.


4 Replies

MG Manu Garg April 9, 2016 12:00 PM UTC

Further anaylsis suggests that the following code triggers something that starts eating cpu cycles:

 e.BrushInfo = New Syncfusion.Drawing.BrushInfo(Color.Gray)
 e.Node.TextColor = Color.WhiteSmoke

this happens irrespective of no. of nodes in the treeviewadv.

Any ideas?


MG Manu Garg April 9, 2016 12:39 PM UTC

Further breaking down into the problem, the e.Node.Textcolor leads to high CPU usage due to unknown reasons.

Solution: use e.Forecolor in the BeforeNodePaint event - it works fine.


SK Senthil Kumaran Rajan Syncfusion Team April 11, 2016 04:30 AM UTC

Hi Manu,

Thank you for your update.

We are glad to know that, your requirement has been achieved. Please let us know if you need any further assistance, we will be happy to assist you.

Regards,
Senthil


SK Senthil Kumaran Rajan Syncfusion Team April 11, 2016 04:30 AM UTC

Hi Manu,

Thank you for your update.

We are glad to know that, your requirement has been achieved. Please let us know if you need any further assistance, we will be happy to assist you.

Regards,
Senthil

Loader.
Live Chat Icon For mobile
Up arrow icon