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.
Unfortunately, activation email could not send to your email. Please try again.

NodeBackgroundPaint Event Fires Very Frequently

Thread ID:

Created:

Updated:

Platform:

Replies:

123675 Apr 9,2016 07:28 AM Apr 11,2016 12:30 AM Windows Forms 4
loading
Tags: TreeViewAdv
Manu Garg
Asked On April 9, 2016 07:28 AM

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 08:00 AM

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 08:39 AM

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 12:30 AM

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 12:30 AM

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.

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.

;