Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 541847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:23:07+00:00 2026-05-13T10:23:07+00:00

Is it possible to make a String in a web part properties editable with

  • 0

Is it possible to make a String in a web part properties editable with a rich text box (to be able to use the Bold, etc.) ?

UPDATE / SOLUTION

The 1st class is the “Custom property” that should appear in the toolbar

   using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Microsoft.SharePoint;    
    namespace MyCustomProperty
    {
        public class RichTextToolbarProperty : Microsoft.SharePoint.WebPartPages.ToolPart
        {

            InputFormTextBox textBox;
            Panel toolPartPanel;

            protected override void CreateChildControls()
            {
                toolPartPanel = new Panel();
                toolPartPanel.GroupingText = "Default text here";
                textBox = new InputFormTextBox();
                textBox.TextMode = TextBoxMode.MultiLine;
                textBox.Rows = 10;
                textBox.RichText = true;
                textBox.RichTextMode = SPRichTextMode.FullHtml;

                BasePublicationWebPart wp = (BasePublicationWebPart)this.ParentToolPane.SelectedWebPart;
                textBox.Text = wp.DefaultText;

                toolPartPanel.Controls.Add(textBox);
                Controls.Add(toolPartPanel);
                base.CreateChildControls();
            }

            public override void ApplyChanges()
            {
                BasePublicationWebPart wp = (BasePublicationWebPart)this.ParentToolPane.SelectedWebPart;
                wp.DefaultText = textBox.Text;
            }

        }
    }

The 2nd class is the WebPart :

using System;
using System.Data;
using System.Text;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.WebControls;

using System.ComponentModel;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.WebPartPages;

namespace MyWebPart
{

    public abstract class BasePublicationWebPart : Microsoft.SharePoint.WebPartPages.WebPart
{

        public string DefaultText
        {
            get
            {
                return _defaultText;
            }
            set { _defaultText = value; }
        }

        public override ToolPart[] GetToolParts()
        {

            ToolPart[] allToolParts = new ToolPart[3];
            WebPartToolPart standardToolParts = new WebPartToolPart();
            CustomPropertyToolPart customToolParts = new CustomPropertyToolPart(); 

            allToolParts[0] = standardToolParts;
            allToolParts[1] = customToolParts;
            allToolParts[2] = new MyCustomProperty.RichTextToolbarProperty(); 

            return allToolParts;
        }
// ... some usual web part code should go here ... ///
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:23:07+00:00Added an answer on May 13, 2026 at 10:23 am

    Yes it is, you might want to inspect, how the “Custom Content Editor Web Part” is built: http://www.codeproject.com/KB/sharepoint/Custom_CEWP_4_SharePoint.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible in ASP.NET to take a string containing some HTML and make
Is it possible to make efficient queries that use the complete regular expression feature
Is it possible to make the text in a TextBox unselectable without disabling the
How is it possible to make prototype methods in C#.Net? In JavaScript, I can
Is it possible to make a site with ASP.NET MVC Framework using .NET 2.0?
Is it possible to make it appear to a system that a key was
Is it possible to make such buttons ( http://img225.imageshack.us/img225/6452/buttonslw9.jpg ) using CSS? It should
Is it possible to make a POST request from Ruby with open-uri?
is it possible to make nant run a publish on mvc project or a
Is it possible to make a batch file which can make a persistent change

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.