CuteEditor for .NET

How to Change the Layout of The Toolbars

Every now and then, developers want to allow users to input rich text but want to keep the data simple, and want to provide only a small selection of buttons. eg. bold, italic, and indent.

The toolbar of CuteEditor by default displays a predefined set of tool buttons. You can easily modify this default setting using the following methods.


1. Load and Edit the configuration file directly.

The following code disables the save, bold buttons:

<item type="image" name="Save" postback="True" Visible="False"/> 
<item type="image" name="Bold" Visible="False"/>
2. Load different configuration file dynamically for different roles/users using Editor.AutoConfigure property. Page:

<CE:Editor id="Editor1" AutoConfigure="Full" runat="server"></CE:Editor>

C#:

if (IsAdmin) { 
Editor1.AutoConfigure = AutoConfigure.Full;
}
else {
Editor1.AutoConfigure = AutoConfigure.Simple;







}

VB:

If IsAdmin Then 
Editor1.AutoConfigure = AutoConfigure.Full
Else
Editor1.AutoConfigure = AutoConfigure.Simple






End If


3. Create/load a custom toolbar configuration file. View the topic:

How to create a custom toolbar configuration file?
4. Set the template or layout to use for the toolbars dynamically using Editor.TemplateItemList property. Page:

<CE:Editor id="Editor1" TemplateItemList="bold,italic" runat="server"></CE:Editor>

C#:

Editor1.TemplateItemList = "bold, italic";

VB:

Editor1.TemplateItemList = "bold, italic"

More information:

How to use TemplateItemList property?

5. Put the toolbar items needed to be disabled into Editor.DisableItemList string. Page:
<CE:Editor id="Editor1" DisableItemList="save,CssStyle" runat="server"></CE:Editor>

C#:

Editor1.DisableItemList = "save, CssStyle";

VB:

Editor1.DisableItemList = "save, help, CssStyle"
6. Create/Add your own custom button dynamically. View the topic:

Add your own custom button