Using LINQ to sort SPLiStItemCOllection:
SPList objRelationShipList;
SPListItemCollection objRelationShipListItems;
objRelationShipList = SPContext.Current.Web.Lists["ListName"];
objRelationShipListItems = objRelationShipList.Items;
List<SPListItem> results = (from SPListItem item in objRelationShipListItems
orderby item.ID
select item).ToList();
foreach(SPListItem in results)
{
....
}
Cheers
Very clever
ReplyDeletehow make order with the custom column instead of orderby item.ID
ReplyDelete