Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

3 Answers 3

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 mysharepointstuff.blogspot.com/2009/08/… –  Steve P Nov 24 '10 at 18:41
add comment

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
add comment

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:

http://www.devx.com/dotnet/Article/31762/1954

share|improve this answer
add comment

Your Answer

 
discard

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