New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Line Spacing Dropdown

Here is an example demonstrating how to create a line spacing dropdown, from which you can change line distance within text:

<asp:ScriptManager ID="ScriptManager1" runat="server">
<telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" OnClientCommandExecuting="OnClientCommandExecuting">
            <telerik:EditorDropDown Name="LineSpacing" Text="Line Spacing" PopupWidth="110" PopupHeight="90">
                <telerik:EditorDropDownItem Name="Default" Value="" />
                <telerik:EditorDropDownItem Name="Single space" Value="20px" />
                <telerik:EditorDropDownItem Name="1.5 Lines" Value="35px" />
                <telerik:EditorDropDownItem Name="Double spacing" Value="50px" />
<script type="text/javascript">
    function OnClientCommandExecuting(editor, args)
        var name = args.get_name();
        var val = args.get_value();
        var cArea = editor.get_contentArea();
        if (name == "LineSpacing")
            if (cArea.firstChild && cArea.firstChild.tagName == "P")
       = val;
                editor.set_html("<p style='line-height:" + val + "'>" + editor.get_html() + "</p>");
In this article
Not finding the help you need? Improve this article