New to Telerik UI for WinForms? Download free 30-day trial

Working with Content Controls UI

The easiest way to create a content control is through the user interface. You can also create them programmatically following the Working with Content Controls article.

User Interface

You can specify which type of content control you wish to insert from the predefined UI of RadRichTextEditor. You can select it from the Developer Tab which is part of the RadRichTextEditorRibbonUI by default:

WinForms RadRichTextEditor User Interface

You can choose between the following content controls:

  • Rich Text content control
  • Plain Text content control
  • Picture content control
  • Repeating Section content control
  • Check Box content control
  • Combo Box content control
  • Drop-Down List content control
  • Date Picker content control

Content controls commands

The following commands related to the content controls functionality are available in the RadRichTextEditor:

  • InsertStructuredDocumentTagCommand

In order to successfully execute the InsertStructuredDocumentTagCommand you have to pass the wanted content control type (SdtType) as a CommandParameter:

Example 1: Execute InsertStructuredDocumentTagCommand

this.radRichTextEditor1.InsertStructuredDocumentTag(SdtType.Picture);

Me.RadRichTextEditor1.InsertStructuredDocumentTag(SdtType.Picture)

Another way is to create a new instance of the InsertStructuredDocumentTagCommand and specify the SdtType in the Execute method:

InsertStructuredDocumentTagCommand command = new InsertStructuredDocumentTagCommand(this.radRichTextEditor1.RichTextBoxElement);
command.Execute("Picture");
//OR
this.radRichTextEditor1.Commands.InsertSdtCommand.Execute("Picture");

Dim command As InsertStructuredDocumentTagCommand = New InsertStructuredDocumentTagCommand(Me.RadRichTextEditor1.RichTextBoxElement)
command.Execute("Picture")
'OR
Me.RadRichTextEditor1.Commands.InsertSdtCommand.Execute("Picture")

  • ShowContentControlPropertiesDialogCommand

In order to execute the ShowContentControlPropertiesDialogCommand you can create a new instance of the command and specify the SdtType in the Execute():

Example 2: Execute ShowContentControlPropertiesDialogCommand

ShowContentControlPropertiesDialogCommand command = new ShowContentControlPropertiesDialogCommand(this.radRichTextEditor1.RichTextBoxElement);
command.Execute("Text");
//OR
this.radRichTextEditor1.Commands.ShowContentControlPropertiesDialogCommand.Execute("Text");

Dim command As ShowContentControlPropertiesDialogCommand = New ShowContentControlPropertiesDialogCommand(Me.RadRichTextEditor1.RichTextBoxElement)
command.Execute("Text")
'OR
Me.RadRichTextEditor1.Commands.ShowContentControlPropertiesDialogCommand.Execute("Text")

In order to learn more about commands and how to use them refer to Commands help article.

In this article