Updated on April 27, 2023
Applies to v23.1.2+, v22.2.6+, v22.1.9+.
Properties that are not (de)serialized:
- Data Editors (DevExpress.XtraEditors.ChartRangeControlClientDataProvider.DataSource)
- Pivot Grid (DevExpress.XtraPivotGrid.PivotSummaryFilter.StartValueInternal)
- Pivot Grid (DevExpress.XtraPivotGrid.PivotSummaryFilter.StartValueInternal)
- Scheduler (DevExpress.XtraScheduler.Reporting.TimeCellsControlBase.HtmlImages)
- Vertical Grid (DevExpress.XtraVerticalGrid.Rows.RowProperties.Value)
The following properties are (de)serialized if they contain simple data types:
- DevExpress.XtraPrinting.NativeBricks.ToggleSwitchTextBrick.TextValue
- DevExpress.XtraPrinting.NativeBricks.CheckBoxTextBrick.TextValue
- DevExpress.XtraPrinting.TextBrick.TextValue
- DevExpress.XtraPrinting.TrackBarBrick.TextValue
- DevExpress.XtraPrinting.ProgressBarBrick.TextValue
IMPORTANT
As part of this security-related enhancement, we also modified (de)serialization-related behavior for the following settings:
- Data Grid sort and group configuration (ColumnView.SortInfo), and MRU filters (ColumnView.MRUFiers)
- Tag property (for multiple controls)
Automatically (de)serialize System.Object type properties for simple data types
Some controls (de)serialize their associated Tag property when they contain the following data types:
- primitive data type (as described in https://docs.microsoft.com/en-us/dotnet/api/system.type.isprimitive?view=netframework-4.7.2)
- string
- decimal
- DateTime
- TimeSpan
- Guid
- nullable variants of these types
Affected controls
- Data Grid (GridSummaryItem.Tag, GridColumn.Tag, BaseView.Tag)
- Tree List (TreeListColumn.Tag)
- Pivot Grid (PivotGridCustomTotalBase.Tag, PivotGridFieldBase.Tag)
- Chart Control (ChartElement.Tag, SeriesPoint.Tag)
- DiagramControl (IDiagramItem.Tag)
- Reports (Parameter.Tag, XRControl.Tag, XRPageBreak.Tag, XRSubreport.Tag)
- Editors (FormatRuleBase.Tag)
- TreeMap and Sunburst Controls (TreeMapItem.Tag, SunburstItem.Tag)
- Vertical Grid (BaseRow.Tag)
- NavBar Control (NavElement.Tag)
Custom type (de)serialization
If a control's Tag property contains a custom type (any type except those mentioned above), the Tag property is not serialized.
If a Tag property in a saved layout contains a custom type, the Tag property is not deserialized.
(De)Serialization for a custom type is only possible for a string. You can implement a converter (via the IOneTypeObjectConverter interface) that converts a custom type to/from a string. This converter is invoked automatically whenever our (de)serialization mechanism encounters a registered custom type.
The following example illustrates how to create a simple converter and register it:
C#using DevExpress.Utils.Serializing.Helpers;
struct CustomType {
public readonly int Value;
public CustomType(int value) {
this.Value = value;
}
}
public class CustomTypeConverter : IOneTypeObjectConverter {
public Type Type {
get { return typeof(CustomType); }
}
public string ToString(object obj) {
return ((CustomType)obj).Value.ToString("D");
}
public object FromString(string str) {
return new CustomType(int.Parse(str));
}
}
// Register the converter at application startup.
ObjectConverter.Instance.RegisterConverter(new CustomTypeConverter());
The attached project illustrates how to (de)serialize a control's Tag property when it stores a custom data type.
Properties that are no longer (de)serialized
- Tree List (TreeList.RootValue)
How to Revert to Previous Behavior
The previous behavior is no longer available.
See also
WPF "Object" properties: Changes made to deserialization mechanism