Sorting on custom properties

Posts   
 
    
SaX
User
Posts: 42
Joined: 29-Apr-2004
# Posted on: 25-Nov-2004 11:40:39   

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?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 25-Nov-2004 12:03:36   

You're using an older verrsion of the runtimes I pressume, as line 593 is not in ApplySort in the 1.0.2004.1 code, or are you using 1.0.2004.1 ?

nevertheless, sorting on non-entity field fields is not supported at the moment, but it should simply ignore these other properties: i.e.: the field is not found and nothing is done.

Frans Bouma | Lead developer LLBLGen Pro
ivanc
User
Posts: 36
Joined: 29-Apr-2004
# Posted on: 21-Sep-2005 14:23:51   

Since there is a new version coming soon I wonder if anything was done about hte question above?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 21-Sep-2005 15:04:43   

this was added to 1.0.2004.2

Frans Bouma | Lead developer LLBLGen Pro