How to change SPListItem.Level property?

116 views Asked by At

I would like to change SPlistitem.Level property in programally. but now , I create program. SPlistitem.Level property is Read Only property. and I try to SPFile.Level property too. but now result is same.

so anyone please how to change SPlistItem.Level Property in programally.

Thanks regard.

1

There are 1 answers

0
Thriggle On

The Level property is a read-only property that indicates whether a file is checked out, checked in as a draft minor version, or published as a major version.

According to the documentation, the three possible values are:

  • Checkout
  • Draft
  • Published

To change the value, perform the appropriate operation on the item's File property.

To check it out: SPListItem.File.CheckOut()
To check it in: SPListItem.File.CheckIn()
To publish it: SPlistItem.File.Publish()