Making text bold

2 posts, 0 answers
  1. Olga
    Olga avatar
    14 posts
    Member since:
    Mar 2011

    Posted 07 Apr 2011 Link to this post


    I can't seem to figure out how the MSWordExample in the richtextbox demo works. I want to understand how when a user types something in the document, then selects and makes bold, it becomes bold. It seems that all you do is specify a command in the xaml to which the B is bound to: ToggleBoldCommand, however where is that command defined? I did something very similar, but it does not seem to work.

  2. Boby
    Boby avatar
    763 posts

    Posted 11 Apr 2011 Link to this post

    Hi Olga,

    The "magic" happens in the RadRichTextBoxRibbonUI.RichTextCommand attached property. You can read more about it in this blogpost (a little outdated, but the main idea remains), this help page, and this forum thread (describing how to create your custom UI for the commands RadRichTextBox exposes).
    Essentially most of the commands exposes event that is raised whenever state changes (e.g. the selection is over bold text); you can subscribe to this event and update the state of the control in the event handler.

    Don't hesitate to contact us if you have other questions.

    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Back to Top