Editor not showing default font details in Content property

4 posts, 0 answers
  1. Silviu
    Silviu avatar
    50 posts
    Member since:
    Feb 2015

    Posted 13 Jan Link to this post

    I have a RadEditor as can be seen below.

    The default font seems to be Arial and size 14. Then I paste some plain text in the editor and yet when I check the txtDescription.Content property the text does not have any font name/size details.

    If I were to change the font/size to anything other than the default values the .Content property contains <span font:... etc which is what I need.

    How can I get this CSS formatting included even with the default font name and size?

     

    <telerik:RadEditor ID="txtDescription" runat="server" Skin="Metro" Width="900px" EditModes="Design"
                                   ContentAreaMode="Div" NewLineMode="Br" NewLineBr="true" EnableAjaxSkinRendering="False" Height="200px" OnClientLoad="RadEditorLoad">
                                    <Tools>
                                        <telerik:EditorToolGroup Tag="MainToolbar">
                                            <telerik:EditorTool Name="SelectAll" ShortCut="CTRL+A / CMD+A" />
                                            <telerik:EditorTool Name="Cut" ShortCut="CTRL+X / CMD+X" />
                                            <telerik:EditorTool Name="Copy" ShortCut="CTRL+C / CMD+C" />
                                            <telerik:EditorTool Name="Paste" ShortCut="CTRL+V / CMD+V" />
                                            <telerik:EditorToolStrip Name="PasteStrip">
                                                <telerik:EditorTool Name="PasteFromWord" />
                                                <telerik:EditorTool Name="PasteFromWordNoFontsNoSizes" />
                                                <telerik:EditorTool Name="PastePlainText" />
                                            </telerik:EditorToolStrip>
                                            <telerik:EditorSeparator />
                                            <telerik:EditorSplitButton Name="Undo">
                                            </telerik:EditorSplitButton>
                                            <telerik:EditorSplitButton Name="Redo">
                                            </telerik:EditorSplitButton>
                                        </telerik:EditorToolGroup>
                                        <telerik:EditorToolGroup>
                                            <telerik:EditorTool Name="Superscript" />
                                            <telerik:EditorTool Name="Subscript" />
                                            <telerik:EditorTool Name="InsertParagraph" />
                                            <telerik:EditorTool Name="InsertGroupbox" />
                                            <telerik:EditorTool Name="InsertHorizontalRule" />
                                            <telerik:EditorTool Name="InsertDate" />
                                            <telerik:EditorTool Name="InsertTime" />
                                            <telerik:EditorSeparator />
                                        </telerik:EditorToolGroup>
                                        <telerik:EditorToolGroup>
                                            <telerik:EditorDropDown Name="FormatBlock">
                                            </telerik:EditorDropDown>
                                            <telerik:EditorDropDown Name="FontName">
                                            </telerik:EditorDropDown>
                                            <telerik:EditorDropDown Name="RealFontSize">
                                            </telerik:EditorDropDown>
                                        </telerik:EditorToolGroup>
                                        <telerik:EditorToolGroup>
                                            <telerik:EditorTool Name="AbsolutePosition" />
                                            <telerik:EditorSeparator />
                                            <telerik:EditorTool Name="Bold" ShortCut="CTRL+B / CMD+B" />
                                            <telerik:EditorTool Name="Italic" ShortCut="CTRL+I / CMD+I" />
                                            <telerik:EditorTool Name="Underline" ShortCut="CTRL+U / CMD+U" />
                                            <telerik:EditorTool Name="StrikeThrough" />
                                            <telerik:EditorSeparator />
                                            <telerik:EditorTool Name="JustifyLeft" />
                                            <telerik:EditorTool Name="JustifyCenter" />
                                            <telerik:EditorTool Name="JustifyRight" />
                                            <telerik:EditorTool Name="JustifyFull" />
                                            <telerik:EditorTool Name="JustifyNone" />
                                            <telerik:EditorSeparator />
                                            <telerik:EditorTool Name="Indent" />
                                            <telerik:EditorTool Name="Outdent" />
                                            <telerik:EditorSeparator />
                                            <telerik:EditorTool Name="InsertOrderedList" />
                                            <telerik:EditorTool Name="InsertUnorderedList" />
                                            <telerik:EditorSeparator />
                                        </telerik:EditorToolGroup>
                                        <telerik:EditorToolGroup>
                                            <telerik:EditorSplitButton Name="ForeColor">
                                            </telerik:EditorSplitButton>
                                            <telerik:EditorSplitButton Name="BackColor">
                                            </telerik:EditorSplitButton>
                                            <telerik:EditorSplitButton Name="InsertSymbol">
                                            </telerik:EditorSplitButton>
                                            <telerik:EditorTool Name="ConvertToLower" />
                                            <telerik:EditorTool Name="ConvertToUpper" />
                                        </telerik:EditorToolGroup>
                                    </Tools>
                                    <Content>
                                    </Content>
                                    <TrackChangesSettings CanAcceptTrackChanges="False"></TrackChangesSettings>
                                </telerik:RadEditor>

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 15 Jan Link to this post

    Hello Silviu,

    Adding CSS file in the CssFiles collection is meant to be referenced only in RadEditor. On the server, there is no built-in utility to append the default style decorations. 

    If the case is to add all default styles as inline ones, you can see if the suggestion in this thread—http://www.telerik.com/forums/radeditor-for-html-emails#Q1a4MHKVKUGammALwYxR-g—can help you out.

    Regards,
    Ianko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Silviu
    Silviu avatar
    50 posts
    Member since:
    Feb 2015

    Posted 15 Jan in reply to Ianko Link to this post

    Hi Ianko,

     Thank you for the above, but are you saying that there is no property of RadEditor which can give me the HTML of the content?

    When toggling to HTML mode from Design, all the HTML markup is being displayed, so how can I access that natively?

  5. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 15 Jan Link to this post

    Hi Silviu,

    The .Content property gives you the HTML content. But it is returned with only the inline styles, no default font name or size is included in the returned HTML. 

    When switching from Design to HTML, the value shown is the innerHTML of the body. On the server, the same value is returned by the .Content property.

    Could you please clarify which default name and size are you referring to in your original question?

    Regards,
    Ianko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top