Dynamic DataBinding

3 posts, 1 answers
  1. Will Vandergrift
    Will Vandergrift avatar
    3 posts
    Member since:
    Mar 2010

    Posted 08 Feb 2011 Link to this post

    First of all, great work on the RadRichTextBox! I'm planning on using the RichTextBox in an application that will share a single RichTextBoxRibbon with several RichTextBoxes. I was wondering what would be the best way to dynamically bind the RichTextBoxRibbon to a specific RichTextBox.

    Thanks,

    Will
  2. Answer
    Boby
    Admin
    Boby avatar
    763 posts

    Posted 09 Feb 2011 Link to this post

    Hello Will Vandergrift,
    This is possible - you can read more details in this blogpost - it's about Silverlight version, but can be used for WPF too. Basically, you can just set DataContext property of RadRichTextBoxRibbonUI to different instances of RichTextBoxCommands:
    this.radRichTextBoxRibbonUI.DataContext = this.radRichTextBox1.Commands;
    and later:
    this.radRichTextBoxRibbonUI.DataContext = this.radRichTextBox2.Commands;

    This can be done on any event you like, including when the RadRichTextBox is focused, or another UI experience relevant one.
    Don't hesitate to contact us if you have other questions. Any feedback on WPF version is welcome too.


    Regards,
    Boby
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. Will Vandergrift
    Will Vandergrift avatar
    3 posts
    Member since:
    Mar 2010

    Posted 09 Feb 2011 Link to this post

    Thanks. That worked great! I was trying to make it more difficult then it has to be.
Back to Top