Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    ContentControlCollection.InsertComboBoxControl(DocumentPosition) Method

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

    Namespace: DevExpress.XtraRichEdit.API.Native

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

    NuGet Package: DevExpress.RichEdit.Core

    #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