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

Within a Document Library with versioning turned on, I noticed that if I create a folder and "View Properties" that there is a "Version: 1.0" that is listed as a property along with "Created By", etc. at the bottom of the page. How do I retrieve this Version value using the SPFolder object?

share|improve this question
add comment

2 Answers

SPFolder has the property Item which gives you the folder's associated list item. This object should have the version and other field values.

share|improve this answer
    
Yes, but the SPListItem only has a Versions (with an 's') property, not an Version (without an 's') property. How do I determine which of the Versions corresponds to the SPFolder that I have? –  Ants Apr 17 '13 at 23:26
    
Now this makes me wonder if folders actually have a version that can change, or if it's just there because a folder is a list item. It looks like they probably don't - changing the name doesn't change the version number, and the version history button is greyed out in the ribbon. –  lgaud Apr 18 '13 at 20:02
add comment

If you were not aware, the Folder object is still considered to be an item in the list. It is just an item of the folder type. So in a lot of cases it is treated like a regular list item. So it just depends on what method you are using to get at this. Client side code or server side code.

share|improve this answer
    
Nuts, I forgot to mention in my question that this was SP2007 object model -- so it is server side code. –  Ants Apr 17 '13 at 23:27
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.