New to Telerik UI for WinForms? Start a free 30-day trial

Serializes RadGridView and RadVirtualGrid layouts with grid-specific handling for column sizing, legacy descriptors, and filter values.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.GridView.dll

Syntax:

C#
public class GridViewLayoutSerializer : ComponentXmlSerializer

Inheritance: objectComponentXmlSerializerGridViewLayoutSerializer

Inherited Members ComponentXmlSerializer.ReadDictionaryElement(XmlReader, object, IDictionary)ComponentXmlSerializer.ReadCollectionElement(XmlReader, IList)ComponentXmlSerializer.ReadCollectionElement(XmlReader, object, IList)ComponentXmlSerializer.ReadCollectionElement(XmlReader, object, IList, bool)ComponentXmlSerializer.ReadMergeCollection(XmlReader, object, PropertyDescriptor, IList, string)ComponentXmlSerializer.ReadMergeCollection(XmlReader, object, PropertyDescriptor, IList, string, bool)ComponentXmlSerializer.ReadMergeCollection(XmlReader, object, PropertyDescriptor, IList, string, bool, bool)ComponentXmlSerializer.MatchExistingItem(XmlReader, IList, object, PropertyDescriptor, string, string, IList, ref int)ComponentXmlSerializer.ReadObjectElement(XmlReader, object)ComponentXmlSerializer.ReadObjectElement(XmlReader, object, object)ComponentXmlSerializer.DisposeObject(IDisposable)ComponentXmlSerializer.ProcessTypeOverride(Type, XmlReader, PropertyDescriptor, object)ComponentXmlSerializer.SetPropertyValue(PropertyDescriptor, object, object)ComponentXmlSerializer.WriteTypeAttribute(XmlWriter, Type, object, DesignerSerializationVisibility)ComponentXmlSerializer.WriteObjectElement(XmlWriter, object)ComponentXmlSerializer.WritePropertyOverride(XmlWriter, PropertyDescriptor, object, DesignerSerializationVisibility)ComponentXmlSerializer.ShouldSerializeValue(object, PropertyDescriptor, PropertySerializationMetadata)ComponentXmlSerializer.WriteDictionaryElement(XmlWriter, IDictionary, object, PropertyDescriptor)ComponentXmlSerializer.InitializeWrite()ComponentXmlSerializer.InitializeRead()ComponentXmlSerializer.GetCollectionElementOverride(IEnumerable, object, PropertyDescriptor)ComponentXmlSerializer.WriteCollectionElement(XmlWriter, IEnumerable, string)ComponentXmlSerializer.WriteCollectionElement(XmlWriter, IEnumerable, object, PropertyDescriptor)ComponentXmlSerializer.GetElementNameByType(Type)ComponentXmlSerializer.RootSerializationObjectComponentXmlSerializer.PropertiesProviderComponentXmlSerializer.ResolveTypesOnlyInTelerikAssembliesComponentXmlSerializer.InstanceFactory...

Constructors

Initializes a new instance of the GridViewLayoutSerializer class.

C#
public GridViewLayoutSerializer(ComponentXmlSerializationInfo componentSerializationInfo)
Parameters:componentSerializationInfoComponentXmlSerializationInfo

The component serialization info.

Methods

Gets a property value for serialization, reversing DPI scaling for a column's width constraints when its owning grid is available.

C#
protected override object GetPropertyValue(PropertyDescriptor property, object propertyOwner)
Parameters:propertyPropertyDescriptor

The property being serialized.

propertyOwnerobject

The object that owns the property.

Returns:

object

The property value, with Width, MinWidth, and MaxWidth converted to logical units when applicable.

Overrides: ComponentXmlSerializer.GetPropertyValue(PropertyDescriptor, object)

Matches the instance of the element by an attribute value and then deserializes its properties. If the instance is not found in existingInstancesToMatch, new instance of type instanceType will be created and added to existingInstancesToMatch list.

C#
protected override object MatchObjectElement(XmlReader reader, object parent, PropertyDescriptor parentProperty, IList toRead, string propertyToMatch, IList existingInstancesToMatch, out int foundAtIndex)
Parameters:readerXmlReaderparentobjectparentPropertyPropertyDescriptortoReadIListpropertyToMatchstringexistingInstancesToMatchIList

the list with existing instances

foundAtIndexint

index of the element if found in existingInstanceToMatch

Returns:

object

Overrides: ComponentXmlSerializer.MatchObjectElement(XmlReader, object, PropertyDescriptor, IList, string, IList, out int)

Override to provide custom processing of collection being deserialized

C#
protected override bool ProcessListOverride(XmlReader reader, object listOwner, PropertyDescriptor ownerProperty, IList list)
Parameters:readerXmlReaderlistOwnerobjectownerPropertyPropertyDescriptorlistIListReturns:

bool

True if the list does not require further processing by the deserializer, False to use the default deserialization

Overrides: ComponentXmlSerializer.ProcessListOverride(XmlReader, object, PropertyDescriptor, IList)

Processes the property.

C#
protected override bool ProcessProperty(PropertyDescriptor property)
Parameters:propertyPropertyDescriptor

The property.

Returns:

bool

Overrides: ComponentXmlSerializer.ProcessProperty(PropertyDescriptor)

Preserves empty filter values when reading layout XML, using null for nullable date and time filter values.

C#
protected override bool ProcessReaderAttribute(XmlReader reader, object parentObject, object toRead, PropertyDescriptor property)
Parameters:readerXmlReader

The XML reader positioned on the serialized property value.

parentObjectobject

The parent object being deserialized.

toReadobject

The object that owns the property.

propertyPropertyDescriptor

The descriptor for the property being read.

Returns:

bool

true when an empty filter value is assigned here; otherwise, false to let the base serializer process it.

Overrides: ComponentXmlSerializer.ProcessReaderAttribute(XmlReader, object, object, PropertyDescriptor)

Deserializes a specified property of an object

C#
protected override void ReadElementInObject(XmlReader reader, PropertyDescriptor property, object toRead)
Parameters:readerXmlReader

Xml reader, positioned on the element corresponding to the property to deserialize

propertyPropertyDescriptor

Property descriptor of the property to deserialize

toReadobject

Object that owns the property to deserialize

Overrides: ComponentXmlSerializer.ReadElementInObject(XmlReader, PropertyDescriptor, object)

Override to provide alternative deserialization of objects.

C#
protected override bool ReadObjectElementOverride(XmlReader reader, object toRead)
Parameters:readerXmlReadertoReadobjectReturns:

bool

value indicating whether the object should be processed any further by serializer

Overrides: ComponentXmlSerializer.ReadObjectElementOverride(XmlReader, object)