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

How can merge two xaml file exported by telerik control

1 Answer 70 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Saurabh
Top achievements
Rank 1
Saurabh asked on 20 Oct 2013, 12:08 PM
Hi,
I have exported two files in  xaml format.Now i want to merge those two files in one.how can it will possible?
Here my code example:
string _xaml1=exported xaml;
string _xaml2=exported xaml data;
  XamlFormatProvider _provider = new XamlFormatProvider();
                Telerik.Windows.Documents.Model.RadDocument _t = new RadDocument();

XamlFormatProvider xamlProvider = new XamlFormatProvider();
                  _t = _provider.Import(_xaml1);
                   _n = _provider.Import(_xaml2);
                                        foreach (Telerik.Windows.Documents.Model.Section section in _n.Sections)
                                        {
                                            Section copySection = section.CreateDeepCopy() as Section;
                                            _n.Sections.Remove(section);
                                            _t.Sections.Add(copySection);
                                        }
    BUT HERE I am getting error while using import method.
Please give me any idea for that.
Thanks,

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 23 Oct 2013, 11:27 AM
Hi,

Generally, the recommended approach when merging documents together is to insert them one after the other as demonstrated in this SDK example. If you do not want to actually show a RadRichTextBox for this purpose you can use a RadDocumentEditor instance in your application.

Additionally, please note that the CreateDeepCopy() methods of document elements are intended for internal purposes mostly and they might not always produce the result you expect, which is why we do not recommend using them.

When it comes to the error you are observing - would you mind sharing more details on the issue? If possible, please provide us with a XAML file that replicates the issue, so that we can investigate it on our side.

I'm looking forward to your reply.

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
Saurabh
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or