Mail Merge Databinding

2 posts, 0 answers
  1. Michael
    Michael avatar
    41 posts
    Member since:
    Oct 2010

    Posted 07 Aug 2013 Link to this post

    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

  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 12 Aug 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top