locked
Sorting Folder and Items in SharePoint List View RRS feed

  • Question

  • Hi,

    I have a SharePoint list having folders and items. By default , folders remain at top in a list . But when I go in list view and enable the "specific criteria" check box , the folders and list items get sorted in either ascending or descending order according to their ID's. My requirement is to get the top five list items based on some caml query criteria. But when I execute my query based on item ID , I still gets the folder at the top and the remaining four as list items.

    For E.g. - I have two folders with ID's as 15 and 21 and few items with ID's as 2,3,5,6,7,10,17,18,19,20,22,23 etc in SharePoint list .When I sort the items through code, i.e. getting the five list items with ID's > 15 , I get the result as 21,17,18,19,20 :(..Instead I must get the result as 17,18,19,20,22.

    Any help will be highly appreciated !!!!

    ==========================================================================================

    Regards,

    Vipul Jain

    Wednesday, December 5, 2012 5:51 PM