# Use RadRichTextBox in Tooltip

## Environment

<table>
    <tbody>
	    <tr>
	    	<th scope="row">Product Version</th>
	    	<td>2019.2.618</td>
	    </tr>
	    <tr>
	    	<th scope="row">Product</th>
	    	<td>RadRichTextBox for WPF</td>
	    </tr>
    </tbody>
</table>

## Description

To bind content to a RadRichTextBox, you need to use one of the available [data providers](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/import-export/features-data-providers). However, popups have their separate visual tree and name scope, so binding outside of it is not possible with ElementName/RelativeSource, due to a limitation in the framework.

## Solution

To have this binding work, you can pass the data through the **Content** property, the value of which will serve as a **DataContext** to the controls that are placed in the **ContentTemplate**. Here is how you can achieve that for a Grid's ToolTip:

> The *Name* is a property of the object used as a DataContext for the ToolTip.

```XAML

    <Grid.ToolTip>
        <ToolTip Content="{Binding}">
            <ToolTip.ContentTemplate>
                <DataTemplate>
                    <Grid>
                        <telerik:HtmlDataProvider RichTextBox="{Binding Path=., ElementName=radRichTextBox}" Html="{Binding Path=Name}}" />
                        <telerik:RadRichTextBox Name="radRichTextBox"  Height="400" Width="1000" />
                    </Grid>
                </DataTemplate>
            </ToolTip.ContentTemplate>
        </ToolTip>
    </Grid.ToolTip>
```

## See Also

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