# RadRichTextBox Displays Content Rendering Glitches

## Environment

<table>
	<tbody>
		<tr>
			<td>Product</td>
			<td>RadRichTextBox for WPF</td>
		</tr>
	</tbody>
</table>

## Description

RadRichTextBox supports two different rendering mechanisms. This article explains what you can expect from them and how you can switch between the two options.

### Direct2D vs TextBlockWithPropertyCaching

The default rendering mechanism of RadRichTextBox uses the **Direct2D** technology and the [FormattedText](https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.formattedtext) class. Although it is **faster**, it can sometimes lead to unexpected behavior when rendering the contents of a document.

The legacy option is the **TextBlockWithPropertyCaching** rendering mechanism which uses draws a single [TextBlock](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.textblock) per line. The advantage here is that this mechanism prevents some rendering glitches which might occur while using the **Direct2D** technology.

Something to note is that the Direct2D option is faster. You might experience some performance diminishments in the rendering when using the **TextBlockWithPropertyCaching**.

## Solution

There are two options allowing you to control the rendering mode of RadRichTextBox. The first one is through the **DefaultTextRenderingMode** property of RadRichTextBox. This is a **static** property and affects all instances of the control. There is also an **instance** property called **TextRenderingMode** which changes the value only for the current instance.

**Changing the Rendering Mode for the Current Instance of RadRichTextBox**

```C#

    this.radRichTextBox.TextRenderingMode = TextBlockRenderingMode.TextBlockWithPropertyCaching;
```

## See Also

* [Data Providers Troubleshooting](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/import-export/features-data-providers#troubleshooting)
