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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

NodeBackgroundPaint Event Fires Very Frequently

Thread ID:

Created:

Updated:

Platform:

Replies:

123675 Apr 9,2016 11:28 AM UTC Apr 11,2016 04:30 AM UTC WinForms 4
loading
Tags: TreeViewAdv
Manu Garg
Asked On April 9, 2016 11:28 AM UTC

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.


Manu Garg
Replied On 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?

Manu Garg
Replied On 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.

Senthil Kumaran Rajan [Syncfusion]
Replied On 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

Senthil Kumaran Rajan [Syncfusion]
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;