I created a collection called m_colLogEntrys. Each time a user creates or updates an existing record in the Windows Form, I am adding to the m_colLogEntrys collection a log note indicating the date and time and what change or what object was created. Each time I add to that collection, I would like to sort that collection in decending order based on DateTime. I have been searching to try to find out how I can do this, but cannot find anything. Can anyone help?
Here is part of my code:
Dim logentry as LogEntry
'This goes to the LogEntry class and creates the new logentry
logentry = COLibrary.LogEntry.GetNewLogEntry(m_guidId, sbText.ToString, LogSource, LogType)
'This adds the new log entry to my collection
m_colLogEntrys.Add(logentry)
'I would like to sort after a new log entry has been added to the collection
???? m_colLogEntrys.Sort??????
Thank you in advance for you help.
Thank you, that worked. Instead of using it in my UI, I decided to use it in my LogEntrys Class. Here is the code if anyone is interest
Public
Function LogEntrysSorted() As SortedBindingList(Of LogEntry)Copyright (c) Marimer LLC