Search This Blog

Wednesday, September 13, 2017

Simplifying the use of ASPxGridListEditor with XPO classes that have composite keys


Starting with the 17.1.4 version, you can use the built-in StructTypeConverter<T> for composite or compound key properties to enable some built-in DevExpress.Web.ASPxGridView functions in ASPxGridListEditor (e.g., inplace editing and the selection column), which would be missing without a type converter.


This converter can be applied to a struct (Structure in VB.NET) representing your complex key using the standard TypeConverterAttribute:

[TypeConverter(typeof(StructTypeConverter<CompoundKey>))]
public struct CompoundKey { ... }


You can view the full example by the documentation link above.


Despite this minor improvement making the lives of certain XAF users easier (and reducing our support costs too), I must emphasize that we do not recommend using composite keys in new apps. XPO supports such keys for legacy databases only and their use imposes some limitations on the default XAF functionality. You can learn more about this from How to create a persistent object for a database table with a compound key


FreeImages.Com/Kirill Levin

No comments:

Post a Comment