Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

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.v19.2.dll

Declaration

public class StructTypeConverter<T> :
    TypeConverter

Type Parameters

Name
T

Remarks

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 19.2\Components\%PROGRAMFILES(x86)%\DevExpress 19.2\.NET Core Desktop Libraries\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
TypeConverter
StructTypeConverter<T>
See Also