Skip to main content
All docs
V24.1

ContentControlCollection.InsertDropDownListControl(DocumentPosition) Method

Creates a drop-down list content control at the specified document position.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.1.Core.dll

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

ContentControlDropDownList InsertDropDownListControl(
    DocumentPosition position
)

Parameters

Name Type Description
position DocumentPosition

The document position where the content controls should be located.

Returns

Type Description
ContentControlDropDownList

The drop-down list content control.

Example

The code sample below creates a drop down list content controls:

image

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using (var wordProcessor = new RichEditDocumentServer()) {
    Document document = wordProcessor.Document;
    var contentControls = document.ContentControls;

    // Insert a drop-down list to select the appointment type:
    var listPosition = document.CreatePosition(document.Paragraphs[2].Range.End.ToInt() - 1);
    var listControl = contentControls.InsertDropDownListControl(listPosition);

    // Add items to the drop-down list:
    listControl.AddItem("First Appointment", "First Appointment");
    listControl.AddItem("Follow-Up Appointment", "Follow-Up Appointment");
    listControl.AddItem("Laboratory Results Check", "Laboratory Results Check");

    listControl.SelectedItemIndex = 1;
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the InsertDropDownListControl(DocumentPosition) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also