protected System.String loadCSS(System.String strFilePath, ref RadEditor radEditor)
{
System.String result = "OK";
try
{
if (strFilePath.IndexOf(":") < 0 && strFilePath.IndexOf("//") < 0)
{
strFilePath = Server.MapPath(strFilePath);//its a virtual path so map it to a physical one
}
System.String strPublishingFolder = Path.GetDirectoryName(strFilePath);
foreach (System.String strCSSfile in Directory.GetFiles(strPublishingFolder, "*.css"))
{
radEditor.CssFiles.Add(strCSSfile);
}//EOF strCSSfile in Directory.GetFiles
radEditor.CssClasses.Add("", "");
}
catch (Exception ex)
{
System.Object oe = (Object)ex;
result = "loadCSS: " + et.rptError(ref oe);
}//try
return result;
}//EOF loadCSS
The rad editor control markup is:
<telerik:RadEditor ID="telerikeditor" Runat="server" OnClientLoad="onClientLoad" OnClientCommandExecuting="OnClientCommandExecuting"> <Tools> <telerik:EditorToolGroup Tag="grpInputOutput"> <telerik:EditorTool ImageUrl="Images/radeditorSave.gif" Name="Save" ShowText="False" Text="Save" /> <telerik:EditorTool ImageUrl="Images/radeditorSaveAs.gif" Name="SaveAs" ShowText="False" Text="Save As" /> <telerik:EditorSeparator /> <telerik:EditorTool Name="PageProperties" /> <telerik:EditorTool Name="Print" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpAids"> <telerik:EditorTool Name="Help" /> <telerik:EditorDropDown Name="Zoom"></telerik:EditorDropDown> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpCheckers"> <telerik:EditorTool Name="AjaxSpellCheck" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpFind"> <telerik:EditorTool Name="FindAndReplace" /> <telerik:EditorTool Name="SelectAll" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpRecover"> <telerik:EditorSplitButton Name="Undo"></telerik:EditorSplitButton> <telerik:EditorSplitButton Name="Redo"></telerik:EditorSplitButton> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpCutNpaste"> <telerik:EditorTool Name="Cut" /> <telerik:EditorTool Name="Copy" /> <telerik:EditorTool Name="Paste" ShortCut="CTRL+V" /> <telerik:EditorSeparator /> <telerik:EditorTool Name="PasteFromWord" /> <telerik:EditorTool Name="StripWord" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpInsert"> <telerik:EditorTool Name="InsertParagraph" /> <telerik:EditorSplitButton Name="InsertSymbol"></telerik:EditorSplitButton> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpTextFont"> <telerik:EditorDropDown Name="FormatBlock"></telerik:EditorDropDown> <telerik:EditorDropDown Name="FontName"></telerik:EditorDropDown> <telerik:EditorDropDown Name="RealFontSize"></telerik:EditorDropDown> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpMarkup"> <telerik:EditorTool Name="ApplyClass"></telerik:EditorTool> <telerik:EditorTool Name="Bold" /> <telerik:EditorTool Name="Italic" /> <telerik:EditorTool Name="Underline" /> <telerik:EditorTool Name="ConvertToLower" /> <telerik:EditorTool Name="ConvertToUpper" /> <telerik:EditorTool Name="InsertHorizontalRule" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpAlignment"> <telerik:EditorTool Name="JustifyLeft" /> <telerik:EditorTool Name="JustifyCenter" /> <telerik:EditorTool Name="JustifyRight" /> <telerik:EditorTool Name="JustifyFull" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpLists"> <telerik:EditorTool Name="InsertOrderedList" /> <telerik:EditorTool Name="InsertUnorderedList" /> <telerik:EditorSeparator /> <telerik:EditorTool Name="Indent" /> <telerik:EditorTool Name="Outdent" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpImages"> <telerik:EditorTool Name="InsertImage" /> <telerik:EditorTool Name="ImageManager" ShortCut="CTRL+M" /> </telerik:EditorToolGroup> <telerik:EditorToolGroup Tag="grpCalendar"> <telerik:EditorTool Name="InsertDate" /> <telerik:EditorTool Name="InsertTime" /> </telerik:EditorToolGroup> </Tools> <Content> </Content> </telerik:RadEditor>
<telerik:GridTemplateColumn HeaderText="Effective From" UniqueName="EffectiveFromEdit" Visible="false"><ItemTemplate><telerik:RadDatePicker ID="rdpMinDateEdit" runat="server" Width="140px" DateInput-EmptyMessage='<%#DataBinder.Eval(Container.DataItem,"EffectiveFrom") %>' MaxDate="01/01/3000" EnableEmbeddedSkins="false" Skin="247"><Calendar ID="Calendar1" runat="server" EnableEmbeddedSkins="false" Skin="247" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"> </Calendar><DateInput ID="DateInput1" runat="server" DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy"EmptyMessage=""></DateInput><DatePopupButton HoverImageUrl="" ImageUrl="" /></telerik:RadDatePicker> </ItemTemplate> </telerik:GridTemplateColumn>GridEditableItem UpdateItem = (GridEditableItem)e.Item;fmsdupdate.EffectiveTo = Convert.ToDateTime((UpdateItem["EffectiveToEdit"].Controls[0] as RadDatePicker).SelectedDate);fmsdupdate.EffectiveFrom = Convert.ToDateTime (((RadDatePicker)UpdateItem.FindControl("rdpMinDateEdit")).SelectedDate);
| <telerik:RadWindowManager ID="windowManager" runat="server"> |
| <Windows> |
| <telerik:RadWindow Skin="Sitefinity" InitialBehaviors="None" VisibleStatusbar="false" |
| Width="650px" Height="725px" Behaviors="Close" ID="wdKitchenSetup" runat="server" |
| Modal="true" Overlay="false"> |
| </telerik:RadWindow> |
| <telerik:RadWindow Skin="Sitefinity" InitialBehaviors="None" Visible="false" Width="400px" |
| Height="400px" Behaviors="Close" ID="wdWashupSetup" runat="server" Modal="true" Overlay="false"> |
| </telerik:RadWindow> |
| </Windows> |
| </telerik:RadWindowManager> |
| function ShowWashupSetup(id) { |
| // Define the ajaxManager |
| var ajaxPanel = $find("<%= ajaxPanel.ClientID %>"); |
| // Concat the arguments |
| var arguments = "Washup, " + id; |
| // Execute the ajax request |
| ajaxPanel.ajaxRequest(arguments); |
| // Define the window manager |
| var manager = GetRadWindowManager(); |
| // Define the url with parameters |
| var url = "ConfigWashup.aspx?id=" + id; |
| // Get the window |
| var wnd = manager.getWindowByName("wdWashupSetup"); |
| // Set the url |
| wnd.setUrl(url); |
| // Show the window |
| wnd.show(); |
| } |
| function ShowKitchenSetup(id) { |
| // Define the ajaxManager |
| var ajaxPanel = $find("<%= ajaxPanel.ClientID %>"); |
| // Concat the arguments |
| var arguments = "KitchenSetup, " + id; |
| // Execute the ajax request |
| ajaxPanel.ajaxRequest(arguments); |
| // Define the window manager |
| var manager = GetRadWindowManager(); |
| // Define the url with parameters |
| var url = "ConfigKitchen.aspx?id=" + id; |
| // Get the window |
| var wnd = manager.getWindowByName("wdKitchenSetup"); |
| // Set the url |
| wnd.setUrl(url); |
| // Show the window |
| wnd.show(); |
| } |
When a RadEditor is inside a RadDock that is collapsed by default the editor control isn't drawn correctly when the dock is expanded. We setup the editor to display in a very basic fashion (no toolbars, displaying statistics and spell check). It appears that the code that runs to size the various parts of the control doesn't execute if the containing dock is collapsed by default and expanding the dock after that doesn't trigger a redraw. Is there a fix or workaround I can implement to correct the behavior?
See the code below (Default.aspx and the ToolFile referenced by the Editor). There is nothing in the code-behind.
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title>Untitled Page</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadDockLayout ID="RadDockLayout1" runat="server"> |
| <telerik:RadDockZone ID="RadDockZone1" runat="server" Width="900px"> |
| <telerik:RadDock ID="RadDock1" runat="server" Width="900px" Height="300px" DockMode="Docked" DefaultCommands="ExpandCollapse" Title="Collapsed" |
| Collapsed="true"> |
| <ContentTemplate> |
| <telerik:RadEditor ID="RadEditor1" runat="server" |
| AutoResizeHeight="true" Height="55px" Width="800px" |
| EnableResize="false" ToolbarMode="Default" EditModes="Design" |
| ToolsFile="ToolFile.xml"> |
| <Modules> |
| <telerik:EditorModule Name="RadEditorStatistics" Enabled="true" Visible="true" /> |
| </Modules> |
| </telerik:RadEditor> |
| </ContentTemplate> |
| </telerik:RadDock> |
| <telerik:RadDock ID="RadDock2" runat="server" Width="900px" Height="300px" DockMode="Docked" DefaultCommands="ExpandCollapse" Title="Expanded"> |
| <ContentTemplate> |
| <telerik:RadEditor ID="RadEditor2" runat="server" |
| AutoResizeHeight="true" Height="55px" Width="800px" |
| EnableResize="false" ToolbarMode="Default" EditModes="Design" |
| ToolsFile="ToolFile.xml"> |
| <Modules> |
| <telerik:EditorModule Name="RadEditorStatistics" Enabled="true" Visible="true" /> |
| </Modules> |
| </telerik:RadEditor> |
| </ContentTemplate> |
| </telerik:RadDock> |
| </telerik:RadDockZone> |
| </telerik:RadDockLayout> |
| </div> |
| </form> |
| </body> |
| </html> |
| <root> |
| <tools name="SpellCheck" enabled="true" DockingZone="Right"> |
| <tool name="AjaxSpellCheck" /> |
| </tools> |
| </root> |