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 Web Forms application when a composite key is used.
Namespace: DevExpress.ExpressApp.Xpo.Utils
Assembly: DevExpress.ExpressApp.Xpo.v24.1.dll
NuGet Package: DevExpress.ExpressApp.Xpo
Declaration
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%\DevExpress 24.1\Components\Sources\DevExpress.ExpressApp\DevExpress.ExpressApp.Xpo\Utils\DefaultStructConverter.cs file. However, you can also create your own as described in the TypeConverter topic.