Skip to main content
All docs
V23.2

ContentControlCollection.InsertComboBoxControl(DocumentPosition) Method

Inserts a combo box content control at the specified document position.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v23.2.Core.dll

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

Declaration

ContentControlComboBox InsertComboBoxControl(
    DocumentPosition position
)

Parameters

Name Type Description
position DocumentPosition

The document position where the content control should be located.

Returns

Type Description
ContentControlComboBox

The combo box content control.

Example

The code sample below creates a combo box:

content control combo box

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

using (var wordProcessor = new RichEditDocumentServer()) {

    Document document = wordProcessor.Document;
    var contentControls = document.ContentControls;

    var comboBoxPosition = document.CreatePosition(document.Paragraphs[2].Range.End.ToInt() - 1);
    var comboBox = contentControls.InsertComboBoxControl(comboBoxPosition);

    comboBox.AddItem("First Appointment", "First Appointment");
    comboBox.AddItem("Follow-Up Appointment", "Follow-Up Appointment");
    comboBox.AddItem("Laboratory Results Check", "Laboratory Results Check");

    comboBox.SetText("Click to enter a type");
}
See Also