Skip to main content
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

NuGet Package: DevExpress.ExpressApp.Xpo

#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%\DevExpress 24.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
TypeConverter
StructTypeConverter<T>
See Also