Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
SDK Documentation
SPList Class
SPList Properties
 Ordered Property
Community Content
In this section
Statistics Annotations (1)
Collapse All/Expand All Collapse All
This page is specific to
The 2007 product release

Other versions are also available for the following:
SPList.Ordered Property (Microsoft.SharePoint)
Gets or sets a Boolean value that specifies whether the option to allow users to reorder items in the list is available on the Edit View page for the list.

Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
Public Property Ordered As Boolean
Visual Basic (Usage)
Dim instance As SPList
Dim value As Boolean

value = instance.Ordered

instance.Ordered = value
C#
public bool Ordered { get; set; }

Property Value

true if the option is available on the Edit View page; otherwise, false.

The Ordered property is true by default for links lists. Setting this property to true for a list of base type Survey, IssueTracking, DocumentLibrary, or DiscussionBoard throws a System.NotSupportedException exception.

The following code example adds to the Edit View page of the specified list the option to allow users to reorder items.

Visual Basic
Dim site As SPWeb = SPContext.Current.Web
Try
    Dim list As SPList = site.Lists("List_Name")
    list.Ordered = True
    list.Update()
Finally
    site.Dispose()
End Try
C#
SPWeb oWebsite = SPContext.Current.Web;
SPList oList = oWebsite.Lists["List_Name"];
oList.Ordered = true;
oList.Update();
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
How to set from UI?      Mpellos   |   Edit   |   Show History
This seems to be a very useful property as it allows to create views of the list where the user can manually set the order of the items. However, I cannot seem to find a way to set this property for a specific existing list, apart from doing it through code. Isn't there a UI setting for this? What other choices are there for changing this property?

One more thing. By setting the property to true, a user cannot simply change the order of the items. He first has to enable the view so that it can be reordered. The property of the view for doing that is SPView.OrderedView, but that is a readonly property and therefore cannot be set programmaticaly, only through the UI. Peculiar...

Any answers are more than welcome!
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker