New to Telerik UI for WinFormsStart a free 30-day trial

Working with Content Controls

Updated on May 7, 2026

This article shows some examples of how you can access a content control and modify their properties from the code. In general, the content controls are marked with annotations and you can manipulate them as such. Detailed information is available here: Manipulating Annotations

Manipulate existing content controls

Get the content controls.

The content controls can be retrieved by using the GetAnnotationMarkersOfType method. This is demonstrated in the following example.

Example 1: Get all Content Controls

C#
IEnumerable<SdtRangeStart> content_controls = this.radRichTextEditor1.Document.GetAnnotationMarkersOfType<SdtRangeStart>();
foreach (var item in content_controls)
{
    Console.WriteLine("Type: {0} ID:{1}", item.SdtProperties.Type, item.SdtProperties.ID);
}

Set content controls properties.

This example shows how you can iterate the items and add an item to a existing ComboBox content control.

Example 2: Adding items to a ComboBox or a DropDownList

C#
foreach (var item in content_controls)
{
    if (item.SdtProperties.Type == SdtType.ComboBox)
    {
        ComboBoxProperties properties = item.SdtProperties as ComboBoxProperties;
        ListItem newItem = new ListItem();
        newItem.DisplayText = "New Item Text";
        properties.Items.Add(newItem);
    }
}

Insert new content controls

New content controls can be inserted trough one of the overloads of the InsertStructuredDocumentTag method accessible from RadRichTextEditor and RadDocumentEditor:

Example 3: Inserting a content control

C#
this.radRichTextEditor1.InsertStructuredDocumentTag();
// OR 
RadDocumentEditor editor = new RadDocumentEditor(this.radRichTextEditor1.Document);
editor.InsertStructuredDocumentTag();

Example 4: Inserting a content control using content control type

C#
this.radRichTextEditor1.InsertStructuredDocumentTag(SdtType.CheckBox);
// OR 
RadDocumentEditor editor = new RadDocumentEditor(this.radRichTextEditor1.Document);
editor.InsertStructuredDocumentTag(SdtType.CheckBox);

Example 5: Inserting a content control using content control properties

C#
SdtProperties sdtProperties = new SdtProperties(SdtType.RichText)
{
    Alias = "AliasName",
    Lock = Lock.SdtContentLocked,
};
this.radRichTextEditor1.InsertStructuredDocumentTag(sdtProperties);
// OR 
RadDocumentEditor editor = new RadDocumentEditor(this.radRichTextEditor1.Document);
editor.InsertStructuredDocumentTag(sdtProperties);

See Also