We are having some trouble with sorting on the custom properties in the datagrid.
We are using adapter scenario with inherited entityClasses.
We added custom properties to the inherited entity class like the following:
[Browsable(true)]
public string CustomProperty
{
get
{
return base.RelatedEntity.Property;
}
}
Collection's AllowSorting propery is set to true.
When the CustomProperty is bound to the DataGrid, it is displayed properly, but when we try to sort on the column based on it (by clicking the datagrid column header), we get the following exception:
An unhandled exception of type 'System.NullReferenceException' occurred in sd.llblgen.pro.ormsupportclasses.net11.dll
Additional information: Object reference not set to an instance of an object.
at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase2.ApplySort(PropertyDescriptor property, ListSortDirection direction) in c:\Myprojects\VS.NET Projects\LLBLGen Pro\RuntimeLibraries v1.0.2004.1\ORMSupportClasses\EntityCollectionBase2.cs:line 593
at System.Windows.Forms.CurrencyManager.SetSort(PropertyDescriptor property, ListSortDirection sortDirection)
at System.Windows.Forms.DataGrid.ColumnHeaderClicked(PropertyDescriptor prop)
What should we do to be able to sort on the Custom properties?