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

I'm working with sharepoint 2007 and i have a question, does a sharepoint library / list has something like property bag, where i could store some properties for the list? Like a SPWeb object. Or maybe not property bag, but something similar?

Or is there only SPWeb.Properties to store the properties?

share|improve this question
add comment

4 Answers 4

up vote 4 down vote accepted

No, as you can see from the msdn documentation, the SPList object does not have a "Property Bag" property.

That said, if you need to, a common workaround is using the property bag of the root folder of the list as a surrogate. You see... SPFolder does define a property bag. Also you can take for granted that a (normal) list or document library should have a root folder: that means that you can store the required properties on the folder (maybe use a custom key prefix to distinguish them from the other properties) and work your solution from here.

share|improve this answer
add comment

How about using hidden columns in the list to store your information? Should be an easy implementation and quite easy to use aswell

share|improve this answer
add comment

You can create an element manifest property bag for a file, folder, list item, or website.

For example:

<PropertyBag HyperlinkBaseUrl="http://contoso.com/sites/EastEnglandSalesOffice"" Url="Lists/CurrentDiscounts" ParentType="ListItem" ItemIndex="23"/>
    <Property Name="DaysToLive" Value="90" Type="int" />
</PropertyBag>

Reference: http://msdn.microsoft.com/en-us/library/gg491705(v=office.14).aspx

share|improve this answer
add comment

why don't you just use property bag of the root web?

To identify your keys just do a prefix of the property a name of your list or its guid or something similar. E.g. youlist_myproperty1, youlist_myproperty2 etc.

To get

SPContext.Current.Site.RootWeb.Properties[key]

or set properties

SPContext.Current.Site.RootWeb.Properties[key] = value

Hope this helps,

Andrew

share|improve this answer
    
nice to know that someone agrees -_- –  SPArchaeologist Apr 2 '13 at 13:17
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.