This is a migrated thread and some comments may be shown as answers.

Dynamic DataBinding

2 Answers 170 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Will Vandergrift
Top achievements
Rank 1
Will Vandergrift asked on 08 Feb 2011, 09:12 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Boby
Telerik team
answered on 09 Feb 2011, 01:11 PM
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>>
0
Will Vandergrift
Top achievements
Rank 1
answered on 09 Feb 2011, 07:09 PM
Thanks. That worked great! I was trying to make it more difficult then it has to be.
Tags
RichTextBox
Asked by
Will Vandergrift
Top achievements
Rank 1
Answers by
Boby
Telerik team
Will Vandergrift
Top achievements
Rank 1
Share this question
or