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

Populate data in "Insert merge field" (Telerik editor)

2 Answers 98 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Vitall
Top achievements
Rank 1
Vitall asked on 20 Apr 2013, 12:41 PM
I really messed up to populate data in WPF Telerik RadRichtextbox, I'm getting dataset from WCF service named as "LetterServiceClient" and now want to populate data in "Mailing"-->"Insert merge field" dropdown, but failed to do so. For your reference i also attached a screen shot to give you a clear look. 
MainWindow.xaml

<telerik:RadRibbonDropDownButton 
         x:Name="ddinsert" 
         Content="" 
         CollapseToMedium="WhenGroupIsMedium" 
         LargeImage="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/InsertMergeField.png"            
         telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding InsertMergeFieldEmptyCommand}" 
         Size="Large" 
         Text="Insert Merge Field" 
         telerik:ScreenTip.Title="Insert Merge Field" 
         />
MainWindow.cs

 private void bindData()
    {
        ServiceReference1.LetterServiceClient letterservice = new ServiceReference1.LetterServiceClient();
        DataSet ds = letterservice.ExecuteTagSchema("SearchPatient");
        List<string> listTemp = new List<string>();
        int i = 0;
        foreach (DataColumn item in ds.Tables[0].Columns)
        {
            listTemp.Add(item.ColumnName);
        }

        this.ddinsert.DataContext = listTemp.ToArray();

        //this.radRichTextBox.Document.MailMergeDataSource.ItemsSource = listTemp.ToArray();
        //this.radRichTextBox.Document.MailMergeDataSource.ItemsSource= listTemp.ToArray();
    }

2 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 23 Apr 2013, 04:02 PM
Hello Umer,

I am not quite sure what you mean.

The drop down button you are refering to is automatically populated with the MailMergeDataSource.ItemsSource of the currently shown document in the editor. That said, you should uncomment that line of code in your project. 

I am also attaching a sample project demonstrating mail merge. The items source is set in the constructor of the window, as well as in the DocumentChanged event handler in order to be set for each new/imported document.

Let me know if I misunderstood you or you have other questions.

Kind regards,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Vitall
Top achievements
Rank 1
answered on 24 Apr 2013, 04:50 AM
Hello Petya,
Good to see your reply. i just see your provided project but problem is in "MainWindow.xaml", some tags are missing thats why shown "Invalid Markup". I can not able to run this project, please take a look.

Thanks. 
Tags
RichTextBox
Asked by
Vitall
Top achievements
Rank 1
Answers by
Petya
Telerik team
Vitall
Top achievements
Rank 1
Share this question
or