Multiple RichTextBox with the same UI

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

    Posted 08 Aug 2013 Link to this post

    Hi,

    I am trying to create email sender using RichTextBox to allow user write email text with Mail Merge.  I have few extra fields like Mail To and Subject where I want user to be able to enter Mail Merge fields.  In other word, I want to have one RadRichTextBoxRibbonUI

    control, but several RichTextBox controls.  For example, when my focus is in Subject field, I should be able to add a Mail Merge to that control. When my focus is in main body, all mail merge fields should go there.  Of course, when I scan through items, both should change.

    If someone can attach a sample program, it would be best.

    Thank you in advance.

    Michael

  2. Boby
    Admin
    Boby avatar
    595 posts

    Posted 12 Aug 2013 Link to this post

    Hi MIchael,
    You can find similar example in Telerik XAML SDK on GitHub here.

    Regards,
    Boby
    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
  4. Michael
    Michael avatar
    41 posts
    Member since:
    Oct 2010

    Posted 12 Aug 2013 Link to this post

    Hi,

    I checked the example you gave me.  It shows 2 RadRichTextBoxes are used.  I think same example was given here: http://www.telerik.com/community/forums/silverlight/richtextbox/one-ribbon-two-richtextboxes.aspx. They change DataContext of the RadRichTextBoxRibbonUI on focus. This is not enough for me.  I am using Mail Merge.  I need to be able to push buttons under Mailing tab to control both RIchTextBoxes at the same time.

    I am developing an Email Editor similar to Outlook's form when you write email. It is one form with one RadRichTextBoxUI and several fields:  From, To, CC, BCC, Subject and Body.  I need to use Mail Merge function so that user can create email template.  Then I want to feed a collection of customer objects and send an email to each one of them separately.  Mail Merge fields are used in Subject, Body and To fields. If there are any example out there, I would really appreciate it.
  5. Boby
    Admin
    Boby avatar
    595 posts

    Posted 14 Aug 2013 Link to this post

    Hello Michael,
    By default, RadRichTextBoxRibbonUI buttons are bound to commands executed for the current RadRichTextBox. You can remove the binding and plug your custom logic, invoking mail merge data navigation commands on both RadRichTextBoxes, for example:
    <telerik:RadRibbonButton telerik:ScreenTip.Description="Preview the next record in the recipient list." LargeImage="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/Next.png" Click="PreviewNextButton_Click"  Size="Large" Text="Next" telerik:ScreenTip.Title="Preview Next Record"/>
    If you compare the above code with the original XAML of RadRichTextBoxRibbonUI, you'll notice that
    telerik:RadRichTextBoxRibbonUI.RichTextCommand attached property is not set and is replaced with custom event handler:
    private void PreviewNextButton_Click(object sender, RoutedEventArgs e)
    {
        this.radRichTextBox1.Commands.PreviewNextMailMergeDataRecordCommand.Execute();
        this.radRichTextBox2.Commands.PreviewNextMailMergeDataRecordCommand.Execute();
    }

    Regards,
    Boby
    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 >>
Back to Top