Help with converting from classic RadEditor

8 posts, 0 answers
  1. Ryan
    Ryan avatar
    17 posts
    Member since:
    Dec 2012

    Posted 17 Dec 2012 Link to this post

    I've been trying to convert a website to use the current Telerik tools but I've been unable to resolve a couple of errors.

    First I cannot seem to find an alternative to RadEditorUtils.Link in the Telerik.Web.UI dll.

    I am also getting some event not found errors on the SubmitClicked and CancelClicked events of the editor. I'm not sure if that will go away once I am able to compile the website.

  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 19 Dec 2012 Link to this post

    Hi,

    You can see how to add custom links dynamically in this article: Custom Links.

    The RadEditor for ASP.NET AJAX was intended to be as simple to configure as possible - and we decided to follow the familiar pattern of Asp:TextBox as this is in fact how the editor is used in almost all cases. The development paradigm is that the editor is a part of a larger page that has some other means of making a postback or a callback - and the editor should not interfere in it. Thus, the Submit and Cancel buttons were removed as well as their SubmitClicked and CancelClicked events.

    You can easily implement a custom Save button in the editor (even simpler than usual, as there is CSS in the editor that will style a tool called Save for you automatically). In case you wish to go this way and want to have a Save tool on the toolbar please see the following help article: http://www.telerik.com/help/aspnet-ajax/addingsaveandcancelbuttonstoolbar.html.

    You can find more information in the following help article: Migration from RadEditor Classic to RadEditor for ASP.NET AJAX.

    Best 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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ryan
    Ryan avatar
    17 posts
    Member since:
    Dec 2012

    Posted 17 Jan 2013 Link to this post

    Thank you, that info helped. I was finally able to get my project to compile.

    However, was something changed when calling AddAjaxSetting? I'm getting a null reference exception where it is called, and it used to work before as is.

    Here's a snippit of my code:

    The error is on the first calling of AddAjaxSettings in the codebehind, but I would imagine that it will happen on all the other one's once it gets there.
    Aspx markup:
    <rada:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="False">
    <AjaxSettings>
    <rada:AjaxSetting AjaxControlID="mnuHomePage">
    </rada:AjaxSetting>
    </AjaxSettings>
    </rada:RadAjaxManager>
    <rada:RadAjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" InitialDelayTime="3">
    <asp:Image ID="Image1" ImageUrl="~/RadControls/Ajax/Skins/Default/Loading.gif" BorderWidth="0px" AlternateText="Loading" runat="server"></asp:Image>
    </rada:RadAjaxLoadingPanel>


    Codebehind:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If User.IsInRole("Administrator") Then
                Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(tAdmin, tAdmin, AjaxLoadingPanel1)
            End If
            If User.IsInRole("Publisher") Then
                Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(tPages, tPages, Nothing)
                Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.mnuHomePage, tPages, AjaxLoadingPanel1)
                Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.mnuPages, tPages, AjaxLoadingPanel1)
                Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.mnuSubPages, tPages, AjaxLoadingPanel1)
                Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.mnuTouts, tPages, AjaxLoadingPanel1)
                Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.mnuTout, tPages, AjaxLoadingPanel1)
            End If
            If Not Page.IsPostBack Then
                If User.IsInRole("Publisher") Then
                    loadPublisher()
                End If
                If User.IsInRole("Administrator") Then
                    loadAdmin()
                End If
                If pnlNav.Items.Count > 0 Then
                    pnlNav.Items(0).Expanded = True
                End If
     
                'pnlNav.Items(0).Selected = True
            End If
        End Sub
        Private Function tPages() As RadTreeView
            Return CType(Me.pnlNav.Items.FindItemByValue("1").Items(0).FindControl("tPages"), RadTreeView)
        End Function
        Private Function tAdmin() As RadTreeView
            Return CType(Me.pnlNav.Items.FindItemByValue("2").Items(0).FindControl("tAdmin"), RadTreeView)
        End Function        
  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 22 Jan 2013 Link to this post

    Hello,

    I suggest you add the code for adding ajax settings inside Page_PreRender event instead of Page_Load and see if it makes a difference.

    All the best,
    Pavlina
    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.
  6. Ryan
    Ryan avatar
    17 posts
    Member since:
    Dec 2012

    Posted 30 Jan 2013 Link to this post

    Thank you, that did fix that error.

    There are some problems I am still troubleshooting, but there is one I cannot find any documentation on. What has the TextElement() client side function changed to?

    This is how I used it:

    function BeforeToggle(node) {
                    if (!node.Expanded)
                        node.TextElement().innerHTML = "<B>Loading...</B>";
                    return true;
                }

    Also, my RadMenu's stopped working. It seems like this has changed to radcontext menu, but I cannot seem to find how to apply them to certain elements programatically. I believe the codebehind I posted before for addajaxsetting was how we did it before.
  7. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 01 Feb 2013 Link to this post

    Hello Ryan,

    Please take a look at the following help article where you can find how you can create and set the different properties of the ContextMenu control from server side - Creating Context Menu at Runtime. You can use the get_contentElement()  or the get_textElement() with the later versions of our controls instead of the TextElement(). Here you can also find more information on the changes.

    Kind regards,
    Kate
    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.
  8. Ryan
    Ryan avatar
    17 posts
    Member since:
    Dec 2012

    Posted 01 Feb 2013 Link to this post

    I get a javascript error when using either get_contentElement or get_textElement: 

    Object doesn't support property or method 'get_textElement'

    get_textElement() also generates this error, which was not there before:
    Object doesn't support property or method 'GetHeight'

    For the menus, I will look into that link you gave me. Thanks.

     

  9. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 05 Feb 2013 Link to this post

    Hi Ryan,

    I noticed that you already opened a support ticket regarding the issues that you are getting. I will paste the answer of the ticket in this forum post as well in case anyone else encounter the same issue and is looking for a similar answer:


    Q1. The treeview menu on the side of the page has text that overflows out of it, and also has an extremely large amount of lag when scrolling. See the attached screenshot.jpg: Notice how the scrollbar is all the way down. These problems do not exist in Google Chrome, only with IE.

    A1.The issue that you get with the RadTreeView control is a bug that is specifically related to the version that you are upgrating to. Please try using the latest version where the issue is already fixed.

    Q2. Before there were menus that popped up when right clicking these items. Now, the menus just all appear at the bottom of the page. I have tried changing the RadMenu's to RadContextMenu's but while it removed the options from the bottom of the page, it did not make the menu's appear.

    A2.I reviewed the code that you provided (although I could not run the entire page) and with the current implementation of the RadMenu it is expected that the menu-s show at the bottom of the page. Please take a look at the following help article and demo where you can find examples how to use context menu with the RadTreeView control:


     
    Q3. When clicking the expand button, before there was a script to have a loading text. This no longer works.

    A3.I would suggest that you use the LoadingStatusTemplate of the RadTreeView and set all of the needed text/images as explained in this forum post.


    Regards,
    Kate
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017