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

Multiple RichTextBox with the same UI

3 Answers 124 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 08 Aug 2013, 07:28 AM
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

3 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 12 Aug 2013, 08:44 AM
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 >>
0
Michael
Top achievements
Rank 1
answered on 12 Aug 2013, 03:34 PM
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.
0
Boby
Telerik team
answered on 14 Aug 2013, 05:59 AM
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 >>
Tags
RichTextBox
Asked by
Michael
Top achievements
Rank 1
Answers by
Boby
Telerik team
Michael
Top achievements
Rank 1
Share this question
or