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.

Changing diagram node background color

Thread ID:





101205 Oct 6,2011 11:56 AM Oct 12,2011 11:27 AM WPF 3
Tags: Diagram
Michael Day
Asked On October 6, 2011 11:56 AM

I need to change the background color of diagram nodes programmatically. I tried using this code segment as suggested in the help:

public Style style { get; set; }

Setter s = new Setter(System.Windows.Shapes.Path.FillProperty, Brushes.AntiqueWhite);
style = new Style();
aNode.CustomPathStyle = style;

and it did get rid of the blue linear gradient background, but it changed it to gray and not AntiqueWhite. Any ideas?

Also, where is the initial blue linear gradient background set for Syncfusion.Windows.Diagram.Node instances?


Michael Day
Replied On October 7, 2011 04:21 PM

Scratch that. I figured it out.

Jegan R [Syncfusion]
Replied On October 8, 2011 02:34 AM

Hi Michael,

We suspect the recent implementation change is the cause of the issue.

In our earlier versions Shape of Node is always Stretched, from 9.3 release we have provided support customizing the Stretch property through CustomPathStyle. As the default value of Stretch is None, Path will not be stretched. We have prepared a sample to overcome this, please refer the sample from attachment.

Please let us know if you have any concerns.



Michael Day
Replied On October 12, 2011 11:27 AM

Thanks, Jegan, I figured that out through trial and error.


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.