title: How to sort a custom list - SecondaryItem within PrimaryItem
body: <p>Hi there have a list of custom objects that I need to be able to sort, one property within another.  How do I go about doing this using .Net.  Normally I would carry out all sorting requirements within the SQL that delivers the data, unfortunately in this case I don't have control over that generation of the raw data.  I consequently have no experience of sorting content using .Net functions such as Linq and/or IComparable.  An impression of the code elements involved are listed below:</p>
  <pre><code> Public Class CustomObject
  
        Public Property PrimaryItem As String
             Get
                  Return _primaryItem
             End Get
             Set(ByVal value As String)
                  _primaryItem = value
             End Set
        End Property
  
        Public Property SecondaryItem As String
             Get
                  Return _secondaryItem
             End Get
             Set(ByVal value As String)
                  _secondaryItem = value
             End Set
        End Property
  
   End Class
  
   Public Class CustomObjectList
        Inherits List(Of CustomObject)
  
        Public Sub New()
        End Sub
   End Class
  </code></pre>
  <p>In essence I want to be able to sort CustomObjectList according to SecondaryItem within PrimaryItem:</p>
  <pre><code>PrimaryItem1
       SecondaryItem1
       SecondaryItem2
       etc...
  PrimaryItem2
       SecondaryItem1
       SecondaryItem2
       etc...
  etc...
  </code></pre>
  <p>Hoping that some kind person will be able to give me a 'leg up' in usage of either Linq and/or iComparable.</p>