Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Custom Property Problem

  Asked By: Edmond    Date: May 23    Category: Sharepoint    Views: 1230

I'm trying to place a custom property in a web part that is a boolean
value and I get the following error.

Web Part Error: One of the properties of the Web Part has an
incorrect format. Windows SharePoint Services cannot deserialize the
Web Part. Check the format of the properties and try again.

If I change the property to a string it works just fine but I would
really rather it be a boolean. Does anyone know how to do this?

Here is the property:

Private Const _defaultBool As Boolean = False
Dim _Maintenance As Boolean = _defaultBool

<Browsable(True), Category("Custom Properties"), DefaultValue
(_defaultBool), Description("Performing Maintenance Do Not Show This
Part To Users"), FriendlyName("Maintenance"), [ReadOnly](False),
WebPartStorage(Storage.Shared)> _
Public Property Maintenance() As Boolean
Return _Maintenance
End Get
Set(ByVal Value As Boolean)
_Maintenance = Value
End Set
End Property



1 Answer Found

Answer #1    Answered By: Cassidy Sharpe     Answered On: May 23

If you have existing string  data, you cannot change  to a Boolean data
type because the property  XML stored in the database will fail to

Didn't find what you were looking for? Find more on Custom Property Problem Or get search suggestion and latest updates.