I’m sure List Views need not be defined here if you are a SharePoint guy. They are frequently used. In short, list views are used to display a particular view of list data with sorting, filtering, grouping etc. As this article is intended for SharePoint developers and administrators, let me quickly get into the point I want to Share. In this article I wish to talk about some cool and not so cool things about List views in SharePoint from my own experience. I hope some of you can benefit.
If we take Task List for example, following are the default views that are installed along with a team site or a document workspace.
All Tasks
My Tasks
Due Today
Active Tasks
By Assigned To
By My Groups
The list view name itself speaks on what’s the kind of view of list data that is displayed by it. Obviously, list views are cool features in SharePoint to present list data. These views can be edited to select/deselect the columns to be displayed, to enable/disable sorting, filtering and grouping, to change items display style, to change items count per page etc.
Enough of good things about the list views, now let s get into some of the limitations and workarounds to them. I will continue with Tasks List for example.
Limitations:
1.)
The listed default views or any custom views for a task list can be viewed as a dropdown list on a standard list view web part tool bar and user can switch between them and view different views of data as shown below:

This is good. But what is not so good is that a view does not appear in the list after you edit it. Thereafter, the only way to access or view the view is by using the view’s web address. A view has its web address assigned to it. For example, for the view My Tasks, the web address is like
http://server/lists/tasks/myitems.aspx
Let’s say if you have edited the view called My Tasks, thereafter, it cannot be viewed anywhere else but using its web address only.
I even copied the list form web parts source code by opening the myitems.aspx page in SharePoint designer and pasted the list form web part in a brand new aspx page. When I opened my new page, I
Was able to see the My Tasks view but it disappeared from the original page i.e.
http://server/lists/tasks/myitems.aspx.
Findings:
The edited view for example My Tasks actually exist in the system. You can create a custom ListviewWebPart and use the edited view to display data where ever you want. Following is a sample source code:
protected override void CreateChildControls()
{
base.CreateChildControls();
SP.WebPartPages.ListViewWebPart lst = new ListViewWebPart();
lst.ListName =
SPControl.GetContextWeb(System.Web.HttpContext.Current).Lists["Tasks"].ID.ToString(“B”).ToUpper();
lst.ViewGuid = SPControl.GetContextWeb(System.Web.HttpContext.Current).Lists["Tasks"].Views[“My Tasks”].ID.ToString(“B”).ToUpper();
lst.ViewType =ViewType.Html;
lst.ChromeType = System.Web.UI.WebControls.WebParts.PartChromeType.None;
lst.GetDesignTimeHtml();this.Controls.Add(lst);
}
Tip if you must have to edit an existing view and you don’t want it to disappear:
Create a custom view from any of the existing views and edit it. SharePoint gives you an option to pick up a standard view or data sheet view etc or existing views to start with to create a new view.
2)
Next limitation applies to Task list. As this is a typical filtering issue, it can exist in other types of lists as well. Please see the article below:
http://sanjayapdl.wordpress.com/2008/03/21/single-web-part-to-display-tasks-assigned-to-current-user-and-current-users-groups/