Dynamic Data 3.5 SP1
For just one of my Dynamic Data Entities tables I would like to control the order of the displayed records, specifically I would like to order a date column descending.
The (SQL Server) table is named "EventLog" with a column "datLocalTimestamp" of type DateTime.
In my "meta" .cs file, I have tried adding the following:
[MetadataType(typeof(EventLogMetaData)), DisplayColumn("datLocalTimestamp", "datLocalTimestamp", true)]
public partial class EventLog
{
}
This did nothing. Next, I tried adding a IComparer class:
internal class EventLogCompare : IComparer<EventLog>
{
public int Compare( EventLog logA, EventLog logB )
{
return DateTime.Compare( logB.datLocalTimestamp, logA.datLocalTimestamp);
}
}
I put a breakpoint on the Compare method but it is never invoked.
Do I need to modify the Page_Load event in the ListDetails.aspx.cs page template file? That doesn't seem like the way to go for a single table...
Thanks for your help.