views:

1069

answers:

1

Hi, I am making a call to Lists.GetListItems web method of sharepoint through my c# code. Is it possible to get sorted list from the sharepoint? Or do I have to sort it after retrieval in my c# code? I was not able to find any option in query or queryOptions.

Thanks.

+1  A: 

See http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems.aspx

GetListItems contains a parameter 'query'. If you pass an xml node in that query with something like:

<OrderBy><FieldRef Name='fieldnametosort' /></OrderBy>

You'll get a sorted list returned.

ArjanP
Thanks a lot Arjan. This should work for me.
Rashmi Pandit