Images dropdown Customization
The Images dropdown of CuteEditor by default displays a predefined set of
Images. You can easily modify this default set using the following methods.
1. Edit Dropdown Configuration File (Common.config).
The dropdown configuration file (Common.config) can be found in the
/CuteEditor/Configuration/Shared folder. In dropdown configuration file you can
find the Images element which contains the configuration information for the Images dropdown within Cute Editor.
You can modify the Images element to create your own Images list.
Example:
- <Images>
- <item text="Logo">
- <value><![CDATA[<img border="0" src="http://www.cutesoft.net/images/logo.gif" />]]></value>
- <html><![CDATA[<img border='0' src='http://cutesoft.net/data/logo_s.gif' /> Company logo]]></html>
- </item>
- <item text="Flower">
- <value><![CDATA[<img border="0" src="http://cutesoft.net/data/j0313820.jpg" />]]></value>
- <html><![CDATA[<img border='0' src='http://cutesoft.net/data/flower_s.gif' /> Flower]]></html>
- </item>
- </Images>
Now the Images dropdown contains the followings:
2. Programmatically populate the Images dropdown
C# Example:
- if (!IsPostBack) {
- CuteEditor.ToolControl toolctrl=Editor1.ToolControls["Images"];
- if(toolctrl!=null) {
- CuteEditor.RichDropDownList dropdown=(CuteEditor.RichDropDownList)toolctrl.Control;
-
- CuteEditor.RichListItem richitem=dropdown.Items[0];
-
- dropdown.Items.Clear();
-
- dropdown.Items.Add(richitem);
-
- dropdown.Items.Add("Logo","<img src="http:
-
- dropdown.Items.Add("<img src='http://cutesoft.net/data/flower_s.gif' /> Flower","Flower","<img src="http://cutesoft.net/data/j0313820.jpg"/>");
- }
- }
VB Example:
- If Not Page.IsPostBack Then
- If Not Editor1.ToolControls("Images") Is Nothing Then
- Dim dropdown As CuteEditor.RichDropDownList
- Dim richitem As CuteEditor.RichListItem
- dropdown = DirectCast(Editor1.ToolControls("Images").Control, CuteEditor.RichDropDownList)
-
- richitem = dropdown.Items(0)
-
- dropdown.Items.Clear()
-
- dropdown.Items.Add(richitem)
-
- dropdown.Items.Add("Logo","<img src="http://www.cutesoft.net/images/logo.gif" />")
-
- dropdown.Items.Add("<img src='http://cutesoft.net/data/flower_s.gif' /> Flower", "Flower", "<img src="http://cutesoft.net/data/j0313820.jpg" />")
- End If
- End If