Sorting a listitem by a custom field

Discussion in 'ASP .Net' started by Simon, Jul 20, 2004.

  1. Simon

    Simon Guest

    Hi everyone,

    I need to sort a list item collection by a sort order value taken from a
    database.

    The first thing that occured to me was that I could inherit from ListItem
    and add a sortOrder field to it. Unfortunately this isnt working because
    listitem is sealed.

    Does anyone know another way to sort the listitem by an int?

    Thank all

    Simon
    Simon, Jul 20, 2004
    #1
    1. Advertising

  2. check for the IComparable interface

    if you are developing your own classes then inherit 'em from IComperable
    or if you're using dataset and/or datatable to bind the data use the
    DataView class

    I would always prefer IComparable ;)

    Murat


    "Simon" <sh856531@microsofts_free_email_service.com> wrote in message
    news:uGfO%...
    > Hi everyone,
    >
    > I need to sort a list item collection by a sort order value taken from a
    > database.
    >
    > The first thing that occured to me was that I could inherit from ListItem
    > and add a sortOrder field to it. Unfortunately this isnt working because
    > listitem is sealed.
    >
    > Does anyone know another way to sort the listitem by an int?
    >
    > Thank all
    >
    > Simon
    >
    >
    Murat KARATUTLU, Jul 20, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rick Spiewak
    Replies:
    3
    Views:
    5,022
  2. Mad Scientist Jr
    Replies:
    2
    Views:
    429
    Mad Scientist Jr
    Jun 29, 2004
  3. Jim in Arizona
    Replies:
    7
    Views:
    903
    Badass Scotsman
    Nov 22, 2006
  4. Sound
    Replies:
    2
    Views:
    428
    Randy Webb
    Sep 28, 2006
  5. jr
    Replies:
    3
    Views:
    405
Loading...

Share This Page