DataFormWebPart custom Property

Oct 10, 2008 at 11:49 AM

I am having problems creating a custom property when using the DataFormWebPart. The properties just don't show, however when I use WebPart only it works perfectly. Could anyone tel-me why is that.
I am developing this web part using VS 2008 SP1.
I have searched @ google but seems that no one came across the same problem. I don't know it's a bug or I am missing something.
Hear is the code:

 

[

 

DefaultProperty("Text"),

 

 

 

ToolboxData("<{0}:APDataFormWebPart runat=server></{0}:APDataFormWebPart>"),

 

 

 

XmlRoot(Namespace = "AlphaPoint.WebPart")]

 

 

 

public class APDataFormWebPart : Microsoft.SharePoint.WebPartPages.DataFormWebPart

//the properties region

 

[

Browsable(true),

 

 

 

Category("Miscellaneous"),

 

 

 

DefaultValue(""),

 

 

 

Description("Path to the WSDL file for the web service"),

 

 

 

FriendlyName("WsdlPath"),

 

 

 

ReadOnly(false),

 

 

 

WebPartStorage(Storage.Shared)]

 

 

 

public string WsdlPath

 

{

 

 

get

 

 

 

 

 

{

 

 

return wsdlPath;

 

}

 

 

set

 

 

 

 

 

{

wsdlPath =

 

value;

 

}

}

 

Could some one please telme what I am doing wrong...

Thank u.

Feb 23, 2010 at 7:38 PM

Instead of [Browsable(true)...

you need to change your properties to:

[Personalizable(PersonalizationScope.Shared)]

[WebBrowsable(true)]