StructTypeConverter<T> Class

Provides the capability to enable some built-in ASPxGridView functions, such as the inplace editing and the selection column in an ASP.NET application when a composite key is used.

Namespace: DevExpress.ExpressApp.Xpo.Utils

Assembly: DevExpress.ExpressApp.Xpo.v18.2.dll

Declaration

public class StructTypeConverter<T> :
    TypeConverter
Public Class StructTypeConverter(Of T)
    Inherits TypeConverter

Type Parameters

Name Description
T

To enable the built-in ASPxGridView functions, such as the inplace editing and the selection column when a composite key is used, the TypeConverterAttribute should be applied to the struct property type. This attribute should specify the Type Converter that is able to convert the key structure to a string and vice versa. In most cases, the built-in StructTypeConverter<T> class can be used as shown below.

using DevExpress.ExpressApp.Xpo.Utils;
using DevExpress.Xpo;
using System.ComponentModel;
//...
[TypeConverter(typeof(StructTypeConverter<CompoundKey>))]
public struct CompoundKey {
    [Persistent]
    public string Property1 { get; set; }
    [Persistent]
    public string Property2 { get; set; }
}

The default StructTypeConverter<T> converter is demonstrated in the %PROGRAMFILES(x86)%\DevExpress 18.2\Components\Sources\DevExpress.ExpressApp\DevExpress.ExpressApp.Xpo\Utils\DefaultStructConverter.cs file. However, you can also create your own as described in the TypeConverter topic.

Inheritance

Object
StructTypeConverter<T>

See Also