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

Changing diagram node background color

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();
style.Setters.Add(s);
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?

Thanks.


3 Replies

MD Michael Day October 7, 2011 08:21 PM UTC

Scratch that. I figured it out.



JR Jegan R Syncfusion Team October 8, 2011 06:34 AM UTC

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.

Regards,
Jegan




NodeStyleTest_e91781b4.zip


MD Michael Day October 12, 2011 03:27 PM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon