ChartSerializer.NonSerializableContent Property

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the chart properties that will not be serialized.

Namespace:   System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

public string NonSerializableContent { get; set; }

Property Value

Type: System.String

A comma-separated string expression that represents the chart properties that will not be serialized. The syntax is "Class.Property[,Class.Property]".

By default all chart properties will be serialized when the Save and Load methods are called. You can use the NonSerializableContent property to limit chart characteristics to be serialized, along with the SerializableContent and Content properties.

This property determines which chart characteristics will not be serialized. Wildcards can be used in the string expression, in the same manner as the SerializableContent property. For example, to exclude all chart BackColor properties from serialization, set this property to "*.BackColor".

Sometimes, a property can be set to be both serialized and not serialized, which is common when wildcards are used. The NonSerializableContent expression has a lower priority when compared to the SerializableContent expression. However, note that less weight is given to string expressions that use wildcards. For example, if the SerializableContent property is set to "*.BackColor" and the NonSerializableContent property is set to BackColor, all BackColor properties except for ChartArea objects will be serialized.

If the Content property has been set, the priority depends on how many wild cards are used in the NonSerializableContent expression. For example, setting the Content property to Appearance will result in the SerializableContent property containing a "*.Back*" expression. If the NonSerializableContent property is set to "*.Back*", all Back* chart properties such as BackColor, BackGradient, and so forth, will still be serialized. This is because the SerializableContent property value has higher priority when compared to the NonSerializableContent property.

This property affects all save, load and reset operations.

.NET Framework
Available since 4.0
Return to top