Sorting a listitem by a custom field

S

Simon

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
 
M

Murat KARATUTLU

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top