Rich Text Box in Share Point 2010

As you guys know that in SharePoint 2010, we have pretty kool ribbon interface… and that the Rich Text Box used in sharepoint uses the functionality within ribbon… So how to add a Rich Text Box in Visual Web Parts or anywhere in Share Point 2010?

Well, the solution is quite simple… We can have a very known Share Point 2007 InputFormTextBox to use in Share Point 2010… Those who are new to SharePoint must know that this was an available control in SharePoint 2007…

   1: <SharePoint:InputFormTextBox ID="txtFeed" runat="server" RichText="true" 

   2: TextMode="MultiLine" RichTextMode="FullHtml" Columns="500" 

   3: Rows="10" />

But as I used this control in my Visual Web Part, I was not able to change the width of the control… neither by its Columns property nor by its Width property… So a work around to this is to have some CSS that is internally used by the control… i.e.

   1: table.ms-rtetoolbarmenu

   2: { width:100%; }

   3:  

   4: iframe.ms-rtelong

   5: { width:100%; } 

This will do the job… hope it might help some one Winking smile

Advertisements

Tagged: , , , ,

10 thoughts on “Rich Text Box in Share Point 2010

  1. waqar janjua April 28, 2011 at 11:26 AM Reply

    I do not have any idea of share point server.
    Can you explain me in few words what is share point ?

    • arsalan.khatri April 30, 2011 at 9:18 PM Reply

      yar i would actually be writing a blog on that… don’t worry
      because its quite difficult to explain SharePoint in few words 🙂

      It has a past related to it, and now its evolving as a platform to built applications… and its being a very powerful platform though :)… will dive into more details… Also for quick look…
      Look into how microsoft explains SharePoint 🙂

  2. Eitvydas Tamošiūnas October 24, 2011 at 7:15 PM Reply

    I would suggest you to use:

    .ms-long{
    width:100%;
    }

    instead of .ms-rtetoolbarmenu

    I used .ms-rtetoolbarmenu, so I’ve got expanded the table the first collumn of the table. That caused other collumns to appear on the right side of the table.

  3. Andrés Ortíz July 27, 2012 at 9:04 PM Reply

    Hi, this solution not work in SharePoint 2010, the tool pane not show, thanks

    • Andrés Ortíz July 27, 2012 at 10:00 PM Reply

      Working in Internet Explorer, not Chrome, sorry, thanks

      • arsalan.khatri July 29, 2012 at 5:12 AM

        yeah normally many items of SharePoint 2010 will not work with chrome 🙂 – So better test everything on IE!

  4. Faz January 29, 2013 at 12:36 PM Reply

    Is there any alternate way to use rich text box in other browsers as the tool pane only work with IE ? there is a client requirement to show tool pane with other browsers also.

    • arsalan.khatri February 23, 2013 at 10:59 AM Reply

      Faz, I seriously doubt if SharePoint is good with other browsers! OOB SharePoint works good, but custom development doesn’t support other browsers… I will let you know if I find something!

  5. vina September 25, 2013 at 12:56 AM Reply

    somehow put the image link without the html?

    • arsalan.khatri September 29, 2013 at 4:32 PM Reply

      Vina, you want to put image without HTML? I don’t think it will be possible, coz this control actually generates HTML at the back-end..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: