This is a migrated thread and some comments may be shown as answers.

Dynamic creation of RadEditor

13 Answers 411 Views
Editor
This is a migrated thread and some comments may be shown as answers.
kgg
Top achievements
Rank 1
kgg asked on 04 Jan 2008, 02:37 PM
Hi.

I have one RadGrid using Usercontrol for edit/insert (EditFormSettings). In the UserControl I need to dynamically create a RadEditor and insert it into the Usercontrol. Now, this was not a problem in RadControls at all, but I'm unable to get it to work with Prometheus. I'm using this code (after the required Prometheus modifications):

 
Dim celle As New System.Web.UI.WebControls.TableCell  
  
Dim textbox2 As New Telerik.Web.UI.RadEditor  
textbox2.ID = oReader("Name")  
textbox2.Skin = "Vista"  
textbox2.EditModes = EditModes.Design  
textbox2.ToolsFile = "~/Scripts/ToolsMinimal.xml"  
textbox2.NewLineBr = True  
textbox2.Width = "600"  
  
Dim oData As DataTableReader = HentVerdier(labelID.Text,oReader("Ordering"))  
Data.Read()  
textbox2.Content = oData("Verdi")  
  
celle.Controls.Add(textbox2)   

And then this code is added to a table and then added to the UserControl.


This is not working with Prometheus. All I get is something like this:

 
 

Same thing in both IE7 and Firefox.

Any ideas?

Kind regards,

Kjell


 

13 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Jan 2008, 03:38 PM
Hi Kjell,

Could you please set EnableOutsideScripts="true" for the RadGrid and you should get the desired result.

Let us know in case this does not solve the problem. Please, open a support ticket and send a sample runnable project that demonstrates the problem along with all project files and folders.


Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
kgg
Top achievements
Rank 1
answered on 04 Jan 2008, 03:53 PM
I'm using Prometheus RadGrid. I'm using this code:

 <telerik:RadGrid ID="gridListe" runat="server" ShowStatusBar="false" 
                    StatusBarSettings-LoadingText="Laster..." StatusBarSettings-ReadyText="Klar" 
                    PageSize="15" AllowPaging="True" AllowSorting="true" 
                     AllowFilteringByColumn="false"
                      
                    <MasterTableView DataKeyNames="ID" AutoGenerateColumns="False" CommandItemDisplay="Top"  
                    AllowPaging="True" AllowSorting="True" GroupLoadMode="Client" > 
 
(...) 
 
EditFormSettings UserControlName="~/UserControls/Ny/Maler/InsertMal.ascx" EditFormType="WebUserControl" > 
                            <EditColumn UniqueName="EditCommandColumn"
                            </EditColumn> 
                        </EditFormSettings> 
                         
                        <CommandItemSettings AddNewRecordText="Legg til nytt dokument" RefreshText="Oppdater" /> 
 
                        <NoRecordsTemplate> 
                            Ingen dokumenter ble funnet. 
                        </NoRecordsTemplate> 
                         
                    </MasterTableView> 
 

0
Social_Quotient
Top achievements
Rank 1
answered on 05 Jan 2008, 02:27 AM
I have the same visible problem with the prometheus editor inside of the doc control. the editor is added dynamically but then the toolbars dont show and I get the same bullets on the page.

I have posted a ticket in support about this but I thought I would add that, we have a similar issue. So if you figure it out please post the outcome here

Thanks
John
0
Petya
Telerik team
answered on 07 Jan 2008, 03:40 PM
Hi,

In case you are dynamically loading RadEditor with AJAX on the page here I am pasting our answer to John:

To solve the problem you need to:
  • copy the Skins folder from your installation folder("C:\Program Files\Telerik\RadControls 'Prometheus') to the root of your application
  • set the property EnableEmbeddedSkins to false - in this way the control will use the CSS from the Skins folder instead of the skins in dll as it would by default
  • manually register the CSS that you use as described in this help article
Let us know if the problem persists.

Sincerely yours,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
kgg
Top achievements
Rank 1
answered on 18 Jan 2008, 08:45 AM
The solution was to upgrade to the recently released prometheus SP1. Now everything seems to be working just fine. :-)
0
Social_Quotient
Top achievements
Rank 1
answered on 18 Jan 2008, 04:29 PM
i want to create Radeditor dynamic .

After spending an hour having  trouble installing the SP1 , the problem persists .
First when i installed , seems nothing happened . Old dlls stay in thier place , and i didnt know what was wrong .
I installed on a second machine and i found new Dlls , fine i thought my pain was over . I copied the new dlls to the bin of my project . Seems the designer broke  and i get "duplicate name errors" allover the project now .
I thought its worth it , i was hoping run time would work .
I ran the page and i still have the same problem Editor looks messy and i get error ,same as i had before SP1  .

"cannot change control collection during init , load , databind , unload "
just when i add a second editor next to the messy one .

i opened a ticket and sent a working sample and no one answered it .
Any help is appreciated  .


 
0
Tervel
Telerik team
answered on 18 Jan 2008, 05:39 PM
Hi,

We received your support ticket and answered it. We are currently taking care and investigating the issue.


Kind regards,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Fred
Top achievements
Rank 1
answered on 12 Feb 2009, 09:57 PM
I have this problem as well when I use Ajax to re-load the Editor.

I can't find the property you mentioned above, EnableOutsideScripts on the AJAX Q3 version.

I might look into trying that other solution you mentioned about moving the skin files.  Except that link you provide doesn't work. http://www.telerik.com/community/forums/aspnet-ajax/help/radcontrols/prometheus/?SkinRegistration.html
 So I'm guessing this is all stuff related to the older version.
0
Rumen
Telerik team
answered on 16 Feb 2009, 02:17 PM
Hi Fred,

Straight to the points:
  1. Please see the following help articles:

    EnableEmbeddedScripts Property (RadControls for ASP.NET AJAX):
    http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.radajaxcontrol-enableembeddedscripts.html
    and
    http://www.telerik.com/help/aspnet-ajax/disabling_embedded_resources.html,

    EnableOutsideScripts: (classic controls)
    http://www.telerik.com/help/aspnet/ajax/radajax-telerik.webcontrols.radajaxutils.radajaxcontrol-enableoutsidescripts.html
    and
    http://www.telerik.com/help/aspnet/grid/RadGrid~Telerik.WebControls.RadGrid~EnableOutsideScripts.html
     
  2. Here is the new link for Skin Registration: http://www.telerik.com/help/aspnet-ajax/skinregistration.html.
Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Fred
Top achievements
Rank 1
answered on 24 Feb 2009, 07:16 PM
Hmm, seems I'm having problems getting this to work.  The embeddedscripts I think is working.. but not the skin
Using Ajax Q3 Editor

On my page I have..

 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"
    <link runat="server" href="~/Stylesheets/Office2007/Editor.Office2007.css" rel="stylesheet" type="text/css" /> 
    <link runat="server" href="~/Stylesheets/Office2007/EditorContentArea.css" rel="stylesheet" type="text/css" /> 
    <link runat="server" href="~/Stylesheets/DSMEditor.css" rel="stylesheet" type="text/css" /> 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"
 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        <Scripts> 
            <asp:ScriptReference Path="~/Javascript/Scripts/Common/Core.js" /> 
            <asp:ScriptReference Path="~/Javascript/Scripts/Common/PopUp/PopUpScripts.js" />           
            <asp:ScriptReference Path="~/Javascript/Scripts/Editor/RadEditor.js" /> 
            <asp:ScriptReference Path="~/Javascript/Scripts/Dialogs/DialogOpener.js" /> 
            <asp:ScriptReference Path="~/Javascript/Scripts/Editor/Modules.js" />          
            <asp:ScriptReference Path="~/Javascript/Scripts/Spell/SpellCheckService.js" /> 
            <asp:ScriptReference Path="~/Javascript/Scripts/Editor/AjaxSpellCheck.js" /> 
            <asp:ScriptReference Path="~/Javascript/Scripts/Window/RadWindow.js" /> 
        </Scripts> 
    </telerik:RadScriptManager> 

Then for my editor, I have..

<telerik:RadEditor ID="reDocument" Runat="server"  
                                                                        Skin="Office2007"  
                                                                        Height="385px" EnableResize="false" 
                                                                        Width="100%" AutoResizeHeight="true" 
                                                                        StripFormattingOnPaste="MSWordRemoveAll"  
                                                                        StripFormattingOptions="MSWordRemoveAll" 
                                                                        EditModes="Design" 
                                                                        EnableEmbeddedSkins="false" 
                                                                        EnableEmbeddedScripts="false" 
                                                                        > 

My Folder structure matches what you see in the code...

/Javascript/Scripts/Common
/Javascript/Scripts/Dialogs
/Javascript/Scripts/Editor
/Javascript/Scripts/Spell
/Javascript/Scripts/Window

/Stylesheets/Office2007/
/Stylesheets/Office2007/Editor
/Stylesheets/Office2007/Editor.Office2007.css
/Stylesheets/Office2007/EditorContentArea.css



But my editor display all crazy now...

All I get is no toolbars and

 
 


Am I missing something?





0
Rumen
Telerik team
answered on 26 Feb 2009, 01:47 PM
Hello Fred,

You should also register the Editor.css file

<link href="Stylesheets/Editor.css" rel="stylesheet" type="text/css" />   

as it is showed in this KB article: Registering an external skin of RadEditor.

If you are unable to solve the problem, please open a support ticket and send a sample working project that demonstrates the appearance problem. I will examine it and once I am able to reproduce the problem on my end I will provide a solution.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Fred
Top achievements
Rank 1
answered on 04 Mar 2009, 07:13 PM
Thanks! That worked great.

Just one last thing, the editor diaglog's like style builder or the link manager come up with no styles at all. Do I need to use all External Dialogs then?
0
Rumen
Telerik team
answered on 06 Mar 2009, 04:17 PM
Hi Fred,

To register the css of the managers you should set the DialogsCssFile property as it is demonstrates in the KB article: http://www.telerik.com/support/kb/aspnet-ajax/editor/register-external-skin-vista-radeditor.aspx

 DialogsCssFile="~/Skins/Office2007/DialogCSS.css"

In the DialogCss.css files add reference to the following files:

@import url("Widgets.Office2007.css");
@import url("ToolBar.
Office2007.css");
@import url("FormDecorator.
Office2007.css");
@import url("TabStrip.
Office2007.css");
@import url("Editor.
Office2007.css");


Greetings,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
kgg
Top achievements
Rank 1
Answers by
Rumen
Telerik team
kgg
Top achievements
Rank 1
Social_Quotient
Top achievements
Rank 1
Petya
Telerik team
Tervel
Telerik team
Fred
Top achievements
Rank 1
Share this question
or