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.
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.
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.
Hi Anuraj
We have created a webpart with a rich textbox using the same code as your post. But we found the rich textbox’s some functionalities are not the same as the Sharepoint default CEWT rich textbox. For example, we can’t upload the images using our custom webpart but it is ok in Sharepoint default CEWT. Do you have any idear to set all the custom webpart’s functions to be same as the Sharepoint default’s?
Thanks,
Hi Aliuon,
Sorry I haven’t tried that. Let me try it. Once I get a solution, I will let you know.
Thanks in advance.