FCKEditor in SharePoint (IE & Non-IE)

In SharePoint, we face one common problem while editing a Rich Text field from Non-IE browsers; the field does not have any Rich text editor. There are few blogs and forum posts showing how we can add FCKEditor in Non-IE browser. But after deployment we will no longer have consistent UI in IE and Non-IE browser for that screen. And after deployment, many users also find th FCKEditor more useful and easy than the default SharePoint Rich Text editor.

So in our project, we decided to use FCKEditor in both IE and Non-IE browser. To do this, I spent some time and came up with the following solution. However after deploying the solution we have tested well and we have not found any side effect, which is very nice 🙂


You can download the FCKEditor controls from here. In our case we have unzipped the control in the following location:

C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATECONTROLTEMPLATES

We have to modify four JavaScript file:


C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATECONTROLTEMPLATES\fckeditor

Add the following configurations in the “fckconfig.js” file to add two new toolbar sets:


Why two?

Multi lines of text has two Rich Text type. One is Rich text (Bold, italics, text alignment) and another is Enhanced rich text (Rich text with pictures, tables, and hyperlinks). In above toolbar set I have listed the appropriate ones, those are supported by the field type. However, you can remove controls, if you want.

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATELAYOUTS\1033

Add the following JavaScript at the end of the “CORE.JS” file. While webpage loading, this JavaScript will replace all textarea with FCKEditor dynamically. This will enable FCKEditor control in both IE & Non-IE browser.


C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATELAYOUTS\1033

Search with RTE_ConvertTextAreaToRichEdit in the file “BFORM.JS”. You will find two results. One of those is a function. Modify the function and put return; as the first statement of the function. This will prevent the function from being executed. The function will look like the following:


C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATELAYOUTS\1033

Follow the same steps as we did for file “FORM.JS”. Search with RTE_ConvertTextAreaToRichEdit in the file “FORM.JS”. You will find one result, a function. Modify the function and put return; as the first statement of the function.

NON_IE.JS (Caution!)
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATELAYOUTS\1033

We should not modify this file any more. To enable FCKEditor in only Non-IE, we need to modify this file. But now we are enabling FCKEditor for both IE and Non-IE. And for that we have modified CORE.JS, which is invoked for all browsers. So we no longer need to modify NON_IE.JS. Well, if you mistakenly modify this file then if you open the page with Non-IE browser, you will find two FCKEditor for each field 🙂

However, I have used JavaScript function SLAC_NonIERichText from this forum.

Sharepoint Object Browser


This application is a SharePoint site object browser which shows all the contents of a SharePoint site in a tree structure. The main objective of this sample program is to show; how to use SharePoint object model. This sample code is a very easy view of SharePoint development. But to develop in SharePoint these are must a developer should know.



There are lots of sample and help about SharePoint administration and customization. But there are very few samples and examples in SharePoint programming. At the beginning, we really had to struggle to develop WebPart and to understand how object model and other SharePoint stuff work. I am working in SharePoint project for nearly one year and I felt to share some of my experiences with others using different sample application. And this is my first example.


What this application does?
This is a SharePoint site object browser application. In the textbox, followed by label Site Address, enter a SharePoint site address and then press Go button. You will see all subsites and content of subsites will be generated in a tree form in the TreeView control. In that control, if you click on a tree node of type list then the list’s contents will be shown in the bottom DataGridView. In the Grid you will find all columns and rows of that particular list. Even some columns, you will see here, will not be visible from SharePoint site. You can also select a column from the DropDownList and can update value for all rows for that particular column. But as I told, you will be able to see some SharePoint internal columns, those values we can not update.


Download Code

I have published the article on CodeProject. So you can download the source code from there. Link.


Understanding the code

We can take SharePoint site instance (SPSite) from site’s URL. Then we can access that SPSite object’s properties.
SPSite site = new SPSite(uxAddress.Text);
TreeNode rootNode = uxBrowser.Nodes.Add(site.Url);
uxBrowser.NodeMouseClick += new TreeNodeMouseClickEventHandler(uxBrowser_NodeMouseClick);
for (Int32 i = 0; i < site.AllWebs.Count; i++)
     SPWeb web = site.AllWebs[i];
     TreeNode webNode = rootNode.Nodes.Add(web.Name);
     for (Int32 j = 0; j < web.Lists.Count; j++)
        SPList list = web.Lists[j];
        TreeNode listNode = webNode.Nodes.Add(list.Title);
        listNode.Tag = list;
Here you can see, fist we are creating an instance of SPSite from a string (site URL) then we are getting AllWebs which is a collection of SPWeb objects. After that we loop through all SPWeb objects and it contents and extracting its information. While doing so, we are also adding these objects’s name and reference (saving in Tag property) in the TreeView control to generate the tree.

Now if you click on list type tree node, it will take the list reference from the Tag property.

_CurrentSelectedList = ((SPList)e.Node.Tag);
Then Fields property of_CurrentSelectedList will return the column collection of that list and finally _CurrentSelectedList.Items will return all rows (items) in that list. To make the data more presentable, I have added all contents in a DataTable then Bind it to the DataGridView.
When the user clicks on list type tree node, I am also assigning the DataTable as Data Source of the DropDownList. Now the user can select a column and update the column’s value. But one problem may arise, while updating the list; if the user does not have permission to update then it will generate an error. This can be solved by impersonating the Sharepointsystem user by using the SPSecurity.RunWithElevatedPrivileges method. This is a technique to use Object Model with full privilege.
     using (SPSite ElevatedsiteColl = new SPSite(siteAddress))
       ElevatedsiteColl.AllowUnsafeUpdates = true;
       using (SPWeb ElevatedSite = ElevatedsiteColl.OpenWeb(webName))

In between this method, the code will execute with an Administrative (Sharepointsystem) privilege. So we will be able to do any kind of read/update/delete operation. In the code you may also have noticed that I am initiating SPSite, SPWeb (those are created repeatedly) in a using block. This is because SPSite and SPWeb is very resource consuming object. So we have to make sure the instance gets disposed after its use.



I keep the source as simple as possible. Still if someone feels that some areas needed to explain more, you are welcome to ask me.