Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharepoint custom web part property does not show up in the toolbox

I have defined a boolean property as follows:

 [Browsable(true), Category("Display"), DefaultValue(false),
  WebPartStorage(Storage.Shared), FriendlyName("Obey Workflow"),
  Description("")]
  public bool ObeyWorkflow { get; set; }

I'm expecting it to render as a checkbox in the webpart's properties toolbox, however it doesn't show up. My web part is derived from the Sharepoint WebPart base class.

like image 411
kjv Avatar asked Mar 05 '09 20:03

kjv


People also ask

How do I add custom web parts to SharePoint?

In the list of SharePoint templates, choose Web Part. In the Name box, specify a name for the web part, and then choose the Add button. The web part appears in Solution Explorer. For more information about the files that a web part includes, see Create web parts for SharePoint.

Is web part feature under discovery?

Available web parts on modern SharePoint Online site in category discovery. Discovery web parts allow you to present a summary of the information on SharePoint site landing pages or Hub Sites.

What is custom web parts in SharePoint?

A custom web part in SharePoint is a personalized web part created by a user for his own use. A site holder or user who has necessary authorization can customize Web Parts page using internet browsers or Microsoft SharePoint Designer to insert, modify or delete a Web Part.


1 Answers

You are on the right track. You just need to use different attributes.

[Personalizable(PersonalizationScope.Shared)]
[WebBrowsable(true)]
[Category("Display")]
[WebDisplayName("Obey Workflow")]  
[Description("")]  
public bool ObeyWorkflow { get; set; }
like image 157
Rob Windsor Avatar answered Oct 14 '22 20:10

Rob Windsor