Globally set NewLineMode="Br"

5 posts, 1 answers
  1. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 21 Jul 2014 Link to this post

    Hi,

    I can't stand the extra space that the new mechanism forces on a new line and have had tons of complaints from my users.  Is there a way to globally set NewLineMode="Br"?

    Regards

    Jon
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Jul 2014 in reply to Jon Link to this post

    Hi Jon,

    Please try the following code snippet to achieve your scenario.

    Create a RadEditorAdapter.cs inside App_Code folder.

    using System;
    using System.Web.UI.Adapters;
    using Telerik.Web.UI;
     
    /// <summary>
    /// Summary description for RadEditorAdapter
    /// </summary>
    public class RadEditorAdapter : ControlAdapter
    {
     
        protected override void OnLoad(EventArgs e)
        {
            var Editor = this.Control as RadEditor;
            if (Editor != null)
            {
                Editor.NewLineMode = EditorNewLineModes.Br;
            }
            base.OnLoad(e);
        }
         
    }

    Create a default.browser inside App_Browsers folder.
    <browser refID="Default">
      <controlAdapters>
        <adapter
          controlType="Telerik.Web.UI.RadEditor"
          adapterType="RadEditorAdapter"
      />
      </controlAdapters>
    </browser>

    Let me know if you have any concern.
    Thanks,
    Shinu.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 21 Jul 2014 in reply to Shinu Link to this post

    Hi Shinu

    That's perfect many thanks - that's a technique that I haven't needed to use so far - should come in very handy :)

    Best Regards

    Jon
  5. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 21 Jul 2014 Link to this post

    Hi guys,

    There is yet another way to control multiple instances of the control in a web site/application by using ASP.NET Themes. See the following help article for more information: Using Themes.

    Best regards,
    Rumen
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Harish
    Harish avatar
    1 posts
    Member since:
    Jul 2015

    Posted 30 Jul 2015 in reply to Shinu Link to this post

    Cant we just set NewLineMode Property to Br while initialization radeditor instance ?
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017