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

Mail Merge Databinding

1 Answer 85 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 07 Aug 2013, 11:06 PM
Hello,

Most of your examples are showing how to use RadRichTextbox (and other controls) using code behind of the xaml.  I am writing application using MVVM pattern. 

In your example, in the code behind you are showing:

radRichTextBox.Document.MailMergeDataSource.ItemsSource = GetMyList()


I need to databind ItemsSource to my list which is in the ViewModel.

Thank you in advance

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 12 Aug 2013, 02:57 PM
Hi Michael,

The MailMergeDataSource.ItemsSource is kept on a per document basis and unfortunately I don't see a way to bind its value. Generally, in MVVM scenarios data providers are used to bind the document shown in RadRichTextBox. As the document instance is changed with a new one each time the respective string it is bound to changes, what I'd suggest is to take advantage of the SetupDocument event of the data provider in code behind. You can set the respective items source hrough the e.Document property of the event arguments.

I hope this is helpful! Let us know if you have further comments or questions.

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
RichTextBox
Asked by
Michael
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or