Skip to main content

RichEditControl.Content Property

Gets or sets the control’s content. This is a dependency property.

Namespace: DevExpress.Xpf.RichEdit

Assembly: DevExpress.Xpf.RichEdit.v22.1.dll


public RichEditDocumentContent Content { get; set; }

Property Value

Type Description

A RichEditDocumentContent class instance used to obtain the control’s content in different formats.


Use the Content property to bind RichEditControl content to HTML, RTF or plain text data.

Note that RichEditControl.HtmlText, RichEditControl.RtfText or RichEditControl.Text properties are not dependency properties, so they cannot be used to bind text to the control. Use one of the following converter to bind data to the Content property:

You can also use the following properties to bind the control to a content data:

Gets or sets a document supplier for RichEditControl. This is a dependency property.
Gets or sets the control’s content as an array of bytes in Office Open XML (Docx) format.

The code sample below binds standard TextControl to the RichEditControl using the ContentToPlainTextConverter class.

A BarManager component enables the hover menu.

View Example: How to implement a converter to bind RichEditControl to the text in different formats

    <dxre:ContentToPlainTextConverter x:Key="ContentPlainConverter" />
    <dxre:RichEditUICommand x:Key="commands" />

        <ColumnDefinition />
    <dxb:BarManager Name="barManager1" Grid.Column="0"> 
                    <dxre:RichEditControl x:Name="richEditControl1"  Height="Auto" Width="Auto" 
                       BarManager="{Binding ElementName=barManager1}" ActiveViewType="Simple" />
    <TextBox Text="{Binding ElementName=richEditControl1, Path=Content, Converter={StaticResource ContentPlainConverter}, Mode=OneWay}" 
        x:Name="textBox1" Grid.Column="1" Height="Auto" Width="Auto"/>

When binding multiple controls to the same data source, set the RichEditControl.UseDeferredDataBindingNotifications property to false to fire the binding-related events at the same time.

See Also