SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to programatically alter existing view "allitems.aspx" aka "All Items" to do an OrderBy (sort by first name and group by department) and only display first, last, m, date of birth, date of hire, last employment date, and department?

share|improve this question

Here is the solution: Changing ListViewWebPart Toolbar and Current View

share|improve this answer
I can't find your post. Can you please edit this answer with more details? Also please remember to mark questions as answered! Thanks :-) – Alex Angas Oct 27 '10 at 2:06
The direct URL seems to be… – Steve P Nov 24 '10 at 18:41

It depends on which list you're talking about, but if all of those columns are in the list, then you should be able to do this just with the view settings.

share|improve this answer
Marc, Yes, bobby is correct. How do i modify existing "All Items" view programatically? – Anonymous Oct 12 '10 at 14:25

An SPView object has a Query property. Get the all items view, then set the existing Query (for allitems probably empty) to include an OrderBy CAML statement, more on this here:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.