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

Globally set NewLineMode="Br"

4 Answers 39 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 21 Jul 2014, 12:21 PM
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

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 1
answered on 21 Jul 2014, 01:08 PM
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.

0
Jon
Top achievements
Rank 1
answered on 21 Jul 2014, 01:34 PM
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
0
Rumen
Telerik team
answered on 21 Jul 2014, 01:49 PM
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.

 
0
Harish
Top achievements
Rank 1
answered on 30 Jul 2015, 12:08 PM
Cant we just set NewLineMode Property to Br while initialization radeditor instance ?
Tags
Editor
Asked by
Jon
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Jon
Top achievements
Rank 1
Rumen
Telerik team
Harish
Top achievements
Rank 1
Share this question
or