This is a migrated thread and some comments may be shown as answers.
RadEditor's DockingZone Work in RibbonBar Mode ?
1 Answer 34 Views
This is a migrated thread and some comments may be shown as answers.
gzzn
Top achievements
Rank 1
gzzn asked on 14 May 2012, 05:21 PM

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebFormEditorDock.aspx.cs" Inherits="X.Model.GOV.Public.WebFormEditorDock" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
<title>RadEditor RibbonBar outerdiv Test</title>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<table width="640px" border="1" style="border-collapse:collapse;">
<tr><td><div id="outerdiv"></div></td></tr>
<tr><td><input type="text" runat="server" value="Please Input Title Here ..." style="width:99%;" /></td></tr>
<tr>
<td>
<telerik:RadEditor ID="RadEditor1" runat="server" ToolbarMode="Default" ToolsFile="~/xml/EditorRibbonBarDock.xml" Width="100%">
<Content>Please Input Text Here ...</Content>
</telerik:RadEditor>
</td>
</tr>
</table>
</form>
</body>
</html>

when i change ToolbarMode="Default" as ToolbarMode="RibbonBar", it work wrong.

EditorRibbonBarDock.xml

<?xml version="1.0" encoding="utf-8" ?>
<root>
<tools name="Base" tab="Base" Enabled="true" DockingZone="outerdiv">
<tool name="PasteStrip" size="large" />
<tool name="Cut" size="medium" />
<tool name="Copy" size="medium" shortcut="CTRL+C" />
<tool name="Print" size="medium" shortcut="CTRL+P" />
</tools>
</root>


1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 16 May 2012, 03:49 PM
Hello,

You can achieve the requested ribbonbar in an outer div functionality using the following code:

<div id="RibbbonBarWrapper" class="RadEditor">
</div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad" ToolbarMode="RibbonBar">
</telerik:RadEditor>
<script type="text/javascript">
function OnClientLoad(editor) {
 $get('RibbbonBarWrapper').appendChild(editor.get_toolAdapter().get_toolsWrapper());
}
</script>

You can also move the RibbbonBarWrapper div to the desired location on the page.


Regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Asked by
gzzn
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or