Does anyone know how to integrate a CKEditor control into a SharePoint 2010 visual web part? I don't want to replace the default SharePoint editor, and I don't want a separate web part unto itself, I just want to incorporate a CKEditor as part of my custom visual web part. I'm able to register the CKEditor control in my package, but when it displays on the rendered control, it's missing the toolbar (it just shows the <TEXTAREA> control).
Any help would be appreciated. Thank you!
Dan
adding CKEditor to webpart
1) Add following at start of your webpart's ascx file <script type="text/javascript" src="/_layouts/ckeditor/ckeditor.js"></script>
2) And you have to add this script below your textarea control
<script type="text/javascript">
CKEDITOR.replaceClass = 'ckeditor';
CKEDITOR.replaceByClassEnabled = true;
var textBox = document.getElementById("<%= txtComments.ClientID %>");
CKEDITOR.replace(textBox, {
width: '500px',
toolbar:[
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike'] },
{ name: 'colors', items: ['TextColor', 'BGColor'] },
{ name: 'styles', items: ['FontSize'] },
{ name: 'clipboard', items: ['Copy', 'Paste', 'Undo', 'Redo'] },
{ name: 'editing', groups: ['Replace', 'spellchecker'] },
{ name: 'insert', items: ['Image', 'Table'] },
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', 'JustifyLeft', 'JustifyBlock'] }
]
}
);
</script>