Default font and line spacing for lists in richtextobx

6 posts, 0 answers
  1. Grigory
    Grigory avatar
    7 posts
    Member since:
    Feb 2015

    Posted 14 Apr 2015 Link to this post

    Hello,

    I use richtextbox with XamlDataProvider, and I would like to change default font size (set it to 8) and line spacing (set it to 1) for bullets and numbered lists. It means, when the control is loaded and a user creates one of the lists, default font size and line spacing should be 8 and 1 (or other values I set in the code)

    I could do such functionality for simple text, but couldn't for lists. In the attached file you can find described issue from a user point of view (if he or she started writing text without any settings changes)

    Below you can also find my code.

    Hope for your help.

    Thanks.

    XAML:

    ... 
     
    <telerik:XamlDataProvider x:Name="XamlDataProvider"  Xaml="{Binding ElementName=RichTextBoxControl, Path=Text, ode=TwoWay}" RichTextBox="{Binding ElementName=Editor}" SetupDocument="XamlDataProvider_OnSetupDocument"/>
     
    <telerik:RadRichTextBox Name="Editor" Grid.Row="1" PreviewMouseDoubleClick="Editor_OnPreviewMouseDoubleClick" IsSpellCheckingEnabled="False" DocumentInheritsDefaultStyleSettings="True" FontSize="12"/>

     

    ...

    C#:

    ... 
     
    private void XamlDataProvider_OnSetupDocument(object sender, SetupDocumentEventArgs e)
    {
        e.Document.ParagraphDefaultSpacingAfter = 0;
        e.Document.LineSpacingType = LineSpacingType.Auto;
        e.Document.LineSpacing = 1;
    }

     

    ...

  2. Tanya
    Admin
    Tanya avatar
    405 posts

    Posted 16 Apr 2015 Link to this post

    Hi Grigory,

    By default, the style settings of the bullets are inherited from the paragraph's style settings. As I am not sure if I properly understand your requirements and in forum posts you can attach only images, could you try to describe your requirements in more details? 

    Regards,
    Tanya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Grigory
    Grigory avatar
    7 posts
    Member since:
    Feb 2015

    Posted 16 Apr 2015 in reply to Tanya Link to this post

    Hello, Tanya.

    It is strange, but my screenshot wasn't attached to my previous message. I'm trying to attach it to this one.

    "By default, the style settings of the bullets are inherited from the paragraph's style settings". For me it doesn't work, so I have different font size for bullets (numbers) and for simple text.  You can see the difference in the attached file.

    Thank you.

     

    Regards,

    Grigory

  5. Grigory
    Grigory avatar
    7 posts
    Member since:
    Feb 2015

    Posted 16 Apr 2015 Link to this post

    Note: I didn't change any settings as a user. I just changed font size in the code (as a developer)
  6. Tanya
    Admin
    Tanya avatar
    405 posts

    Posted 21 Apr 2015 Link to this post

    Hello Grigory,

    This behavior could be observed if the FontSize property is set to the text, but not to the paragraph end symbol. If you select the text and then change the FontSize, please, check the selection and verify that the symbol is selected along with the text.

    If this is not helpful for you, it would be great if you share the code you are using for changing the font size and confirm that you are using the latest version of our controls.

    Regards,
    Tanya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  7. Grigory
    Grigory avatar
    7 posts
    Member since:
    Feb 2015

    Posted 19 May 2015 in reply to Tanya Link to this post

    Hello Tanya,

     

    Thank you for trying to help me with my issue.

    I've finally found out the reason of the problem. I used the old telerik libraries (I don't have license for the latest ones). However, I checked this issues with the actual libraries in test mode, and it works. Probably, there were a bug in the old ones.

     

    Regards,

    Grigory

Back to Top
UI for WPF is Visual Studio 2017 Ready