Telerik blogs

The first release of 2012 is already a fact and even though this Q has been shorter due to the shift in the release dates which Todd Anglin blogged about, we managed to include some long-awaited improvements and new features.

The first and most important change is that RadRichTextBox now supports multiple sections in the document. To see how it works, you can open the Silverlight demo, choose the Page Layout tab from the RibbonUI and click “Breaks”.


Inserting a section break will split the current section into two, providing the option to format the two parts differently. Section breaks are extremely useful when you want to have different layout of pages in the document – margins and/or orientation. Furthermore, each section can have a different set of headers and footers, which in addition to the customizations within one section – Default header/footer, Even and Odd page, lays the foundations for the creation of more complex and sophisticated documents.

You can also specify whether the next section should start with an even or odd page similarly to how this can be done in Microsoft Word. The section breaks and the headers/footers will be imported and exported in most formats – XAML, docx, RTF and PDF (export only).

Another major feature we have been working on over the last two releases is Styles support. The usage of styles allows easier formatting of the document while at the same time preserving the consistent look of the document. Styles can be created and added to a document programmatically or via the ManageStylesDialog.

The supported styles are for paragraph, character and table. Last but not least, styles are persisted in docx, XAML and HTML, so they can also be instantiated on import.

In 2012 Q1 we have done our best to make data binding easier, to better enable scenarios like MVVM. Previously, to bind RadRichTextBox, you had to introduce a new object to the visual tree - a data provider - and bind it to the editor. In the new release, we have removed a lot of that complexity altogether and now you only need to bind an attached property (on the editor) to your desired data source. Here's an example:

<telerik:RadRichTextBox html:HtmlDataProvider.Source="{Binding MyModelProperty}" />

This example utilizes HtmlDataProvider, but you can use any other in its place, depending on the needs of your application.

Also, due to popular demand, we have introduced a DocxDataProvider, so now you can also bind your byte[] properties the same way you do with the string ones. It too features the Source attached property as shown above.

Stay tuned for more interesting news around RadRichTextBox. Your feedback, as always, will be much appreciated.


About the Author

Iva Toteva

is a software developer and works closely with clients to assist them in utilizing the RadControls they use for the purposes of their application. The controls in her domain include RadRichTextBox, RadSpreadsheet and RadPdfViewer.

Related Posts

Comments

Comments are disabled in preview mode.