Home > .Net, sharepoint > Sharepoint Rich Text box in Webparts

Sharepoint Rich Text box in Webparts

In my current project, I have to develop a webpart, in which users should able to Add / enter comments using Sharepoint native rich text box. I have tried, RichTextField, I am able to add it, but while rendering it is giving a lot of problems like, Control mode not set etc.

After some “google”ing I found some other control, the InputFormTextBox, using this, I am able to create a webpart, which uses sharepoint default Rich Text Editor.


InputFormTextBox txt = new InputFormTextBox();
txt.TextMode = TextBoxMode.MultiLine;
txt.RichText = true;
txt.RichTextMode = SPRichTextMode.Compatible;

And you can use txt.Text property to read the contents of the Textbox. I am adding / inserting the Text to a multiline column in a custom list.

Categories: .Net, sharepoint Tags:
  1. John P
    June 4th, 2008 at 21:22 | #1

    Hi,
    I’ve been trying to get this Rich Text control working in a custom aspx page. The control renders, but without the rich text editing ribbon on the top. It just looks like a normal multiline textbox. My code for this is below if you’ve got any idea why this is happening I would very much appreciate any help. Thanks in advance

    Assembly Reference:

    Control Definition:

    John P.

  2. June 5th, 2008 at 10:41 | #2

    Hi John

    I am unable to see your code. :(
    And I was done in WSS 3.0, C# and .Net 2.0 and in Custom WebPart, not in a page. Anyway if you can please give me the code, I will try to look into it.

  1. No trackbacks yet.