Font Size Increasing in Context Menu

4 posts, 0 answers
  1. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 16 Jul 2012 Link to this post

    This is definitely odd, but it seems the font for my context menu in the RadRichTextBox is being change according to the font I select.  See the attached image for an example.

    Thanks in advance,
    Steve
  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 19 Jul 2012 Link to this post

    Hi Steve,

    Thank you for letting us know about this problem. This is a known issue and it is added to our to-do list. Unfortunately, we can't tell if and when it will be fixed. We have created a public PITS issue, which you can use to follow our progress.
    You can follow the PITS Issue by its ID: 11941
    Public Url: http://www.telerik.com/support/pits.aspx#/public/silverlight/11941 

    Please, excuse us for the inconvenience. Don't hesitate to contact us if you have other questions.

    All the best,
    Petya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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

    Posted 31 Jul 2014 in reply to Petya Link to this post

    Hello, I've got same issue with DevCraft Q2 2014 Release. And I can't find the PITS Issue you've mentioned. I'm using default context menu with spellchecking suggestions and several customized groups.

    How can I change font size of context menu?

    Here is the xaml of my control.

    <telerik:RadRichTextBox x:Name="TextEditorRichTextBox"
                 AcceptsReturn="True"
                 AcceptsTab="False"
                 BorderThickness="0"
                 DocumentInheritsDefaultStyleSettings="True"
                 FontSize="{na:Settings EditorFontSize,
                           ConverterKey=UseFontToDipConverter}"
                 HorizontalScrollBarVisibility="Auto"
                 IsContextMenuEnabled="True"
                 IsReadOnly="{Binding Path=DataContext.IsTextReadOnly,
                 RelativeSource={RelativeSource FindAncestor,
                 AncestorType=views:DocumentView}}"
                 IsSelectionMiniToolBarEnabled="False"
                 IsSpellCheckingEnabled="{na:Settings IsSpellCheckingEnabled, Mode=OneWay}"
                 LayoutMode="Flow"
                 SelectionChanged="TextEditorRichTextBox_OnSelectionChanged"
                 VerticalScrollBarVisibility="Visible" />



    And here is customization of contextMenu:

    ....
         contextMenu.Showing += SetContextMenu;
    }
     
    private void SetContextMenu(object sender, Telerik.Windows.Controls.RichTextBoxUI.Menus.ContextMenuEventArgs e)
    {
         var contextMenusToDelete = e.ContextMenuGroupCollection.Where(
                    a => a.Type == ContextMenuGroupType.HyperlinkCommands ||
                    a.Type == ContextMenuGroupType.TextEditCommands ||
                    a.Type == ContextMenuGroupType.Custom).ToList();
     
         if (contextMenusToDelete.Any())
         {
               foreach (var ctxMenu in contextMenusToDelete)
               {
                    e.ContextMenuGroupCollection.Remove(ctxMenu);
               }
          }
     
         var reformatCommand = FindResource("ReformatTextCommand") as RoutedCommand;
         var externalEditingCommand = FindResource("ExternalEditingCommand") as RoutedCommand;
     
         if (reformatCommand != null || externalEditingCommand != null)
         {
              var contextMenuGroup = new ContextMenuGroup(ContextMenuGroupType.Custom, "Ria Commands");
     
              if (reformatCommand != null)
              {
                   var menuItem = new RadMenuItem();
                   {
                        menuItem.Command = reformatCommand;
                    };
     
                    menuItem.Header = Strings.ReformatText;
     
                    contextMenuGroup.Add(menuItem);
                }
     
                if (externalEditingCommand != null)
                {
                      var menuItem = new RadMenuItem();
                      menuItem.Command = externalEditingCommand;
                      menuItem.Header = Strings.LocalizedString0975;
     
                       contextMenuGroup.Add(menuItem);
                 }
     
                  e.ContextMenuGroupCollection.Add(contextMenuGroup);
           }
    }



  5. Petya
    Admin
    Petya avatar
    975 posts

    Posted 04 Aug 2014 Link to this post

    Hi Grigory,

    Upon further investigation it turns out there is not much we can do to fix the problem. At this point the best I can do is suggest the following two workarounds:
    - Modify the Normal style in the repository of each document loaded in the control. You can read more on the topic in the Styles article.
    - Use implicit styles in your project. This, in fact, adds other benefits to your project as you can read in the XAML Theming – Implicit Styles versus StyleManager blogpost.

    I hope this helps.

    Regards,
    Petya
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top