Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
117 views
I have an existing rad editor in a webpage that loads an HTML document with css markup.  The document contains links to external css files, and both the document and its css files are in a completely different place than that of the folder in which the editor webpage resides.  I programatically add the css files to the editor through the codebehind.

When I run the editor, the document loads and renders with the correct css markup in design mode.  When I move the editor's cursor over the content area, the ApplyClass toolbar button displays the correct name of any class that happens to be under the cursor's position.  But, when I expand the ApplyClass droplist, I find that it is empty with the exception of a single entry "Clear Class".  The droplist does not contain any of the classes in the css files I've programatically added to the cssfiles property.

My understanding is that if the cssclasses property is set to be empty, the editor should automatically load all the class names contained in the files specified by cssfiles.  I've done this too, but it didn't help.  Do you know what's going wrong?  I don't want to hardcode any class names as the css files are dynamically generated and will always be changing for each editing session.

I'm using Telerik RAD controls 2011.2.915.35 on windows 7 SP1 and am launching the page from inside of visual studio 2008 on the personal web browser.

The code in which I take a directory of the document folder and add all the css files found follows:

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>
Rumen
Telerik team
 answered on 08 Nov 2011
1 answer
396 views
Hi,
 I am getting the exception message during Clear the control information.
Actually we have a panel that contain search criteria with clear button. If I serch any thing and related information getting into grid.
after editing this grid information when I clicked to clear button a exception message showing. as below

"Sys.WebForms.PageRequestManagerServerErrorException: Script control 'Ddxyz' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors(). Parameter name: scriptControl" Please try again

Please help me How can I short out this exception message.

Thanks
Jaichand
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Nov 2011
2 answers
112 views
I have been given a page where all the colums are defined in the front end code. I have always built my tables up in the code behind and never had a problem extracting values from the table. Here is an example of a column that i am having difficulty getting a value from:
<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>

In the code behind, here is the code i am attempting to use, this works on pages where i have defined the columns in the code behind:
GridEditableItem UpdateItem = (GridEditableItem)e.Item;
fmsdupdate.EffectiveTo = Convert.ToDateTime((UpdateItem["EffectiveToEdit"].Controls[0] as RadDatePicker).SelectedDate);

I have also tried to explicity accces the control (this works for other controls on this page):

fmsdupdate.EffectiveFrom = Convert.ToDateTime (((RadDatePicker)UpdateItem.FindControl("rdpMinDateEdit")).SelectedDate);

The date always comes back as 00/00/0001 or null despite a date being picked in the control. Any help on this would be greatly appreciated
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Nov 2011
3 answers
225 views
every time I paste a table from MS word the formatting gets all screwed up.  either the width is too much or the font is wrong.  In one particular case, it was adding the <p class = "tlbBody"> to certain cells.  I have found no way to get rid of that using the edit buttons.  I can manually delete the <p class> statement but that is so much work; it would be easier to recreate the table from scratch.

I can paste in text that has a font is not included with Radeditor.  so how does that work? is the recommendation to only use the built in fonts that Radeditor has?  because if I ever accidently switch fonts I can no longer type in that font.

is there a preferred web browser to edit with?
Rumen
Telerik team
 answered on 08 Nov 2011
2 answers
179 views
Hi There,

I had the thought today that it would be nice to have a button in the title bar of my RadDocks which would "pop" them out of their DockZone and make them freely draggable around the screen.  I see that there is an undock() function, but is there a way to add this functionality to the title bar?

It looks as if I would have to create a custom template for the title bar, but I am not sure how to go about that.

Thanks for any help,

Daniel
Slav
Telerik team
 answered on 08 Nov 2011
9 answers
259 views
Hi all,

Have a question about multiple RadWindows on one page that I try to open client-side.

These are my windows defined on my page:
<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> 

These are the js functions I use.
The ShowKitchenSetup is working okay. It shows a popup with the content of the referred url.
The ShowWashupSetup gives an error. (see thread title)

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(); 
            } 

Anyone has an idea why this won't work?

Thanks,
Daniel
Subhash
Top achievements
Rank 1
 answered on 08 Nov 2011
2 answers
162 views

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> 

 

Yeroon
Top achievements
Rank 2
 answered on 08 Nov 2011
1 answer
135 views
I am using CustomProvider to show files from a shared network drive in a web application.

when user 'Open' a file from the FileExplorer, modify the file and hit 'save' they will expect to save the file back to the Server directly( Ignoring the file was actually stored in internet temporary folder).

does anybody have solution or suggestion on it?

Thanks


Dobromir
Telerik team
 answered on 08 Nov 2011
1 answer
66 views
hi
AsyncUpload not well formed in opera when document is Right-to-left
please fix it!
http://demos.telerik.com/aspnet-ajax/asyncupload/examples/rtl/defaultcs.aspx
thanx
Kate
Telerik team
 answered on 08 Nov 2011
1 answer
60 views
Hi,

Does anybody have experience with the ASP.NET AJAX  components on CEHTML (Consumer Electronics HTML).
We have some inquiries regarding Smart TV apps and of course :-) we want to use Telerik.

please let me know.

BR Marc

Sebastian
Telerik team
 answered on 08 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?