CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    80

    Sort List of objects

    Ive got a list full of AdminLink objects that have the attributes "Title" "URL" and "Description". How would I sort the list of objects by their Title? Thanks.

  2. #2
    Join Date
    Jun 2005
    Posts
    121

    Re: Sort List of objects

    Hi there,
    You should implement IComparable overriding int CompareTo(object obj) where you do the comparison based on Title. Then you use the Sort method provided by the ArrayList.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured