Skip to main content
All docs
V24.1

TextEditAdvancedModeOptions.AutoCompleteCustomSource Property

Gets or sets a custom collection of auto-complete suggestions. This property is in effect in advanced mode when the AutoCompleteSource option is set to CustomSource.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Behavior")]
public AutoCompleteStringCollection AutoCompleteCustomSource { get; set; }

Property Value

Type Description
AutoCompleteStringCollection

The TextEdit’s custom string collection source.

Property Paths

You can access this nested property as listed below:

Object Type Path to AutoCompleteCustomSource
RepositoryItemTextEdit
.AdvancedModeOptions .AutoCompleteCustomSource

Remarks

To supply custom auto-complete suggestions to the editor, set the AutoCompleteSource property to CustomSource, and populate the AutoCompleteCustomSource collection with the suggestions. You can also handle the RepositoryItemTextEdit.CustomizeAutoCompleteSource event to supply custom auto-complete suggestions dynamically.

A text editor automatically sets the AutoCompleteSource property to CustomSource when you set the TextEditAdvancedModeOptions.AutoCompleteMode option to SuggestSingleWord.

Example

The example below uses the TextEditAdvancedModeOptions.AutoCompleteCustomSource property to supply custom auto-complete suggestions for a text editor.

AutoCompleteCustomSource - example

  private void Form1_Load(object sender, EventArgs e) {
    // Define a custom string collection.
    var DaysOfTheWeek = new AutoCompleteStringCollection();
    DaysOfTheWeek.AddRange(new string[]
      {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"});

    // Activate advanced mode.
    textEdit1.Properties.UseAdvancedMode = DevExpress.Utils.DefaultBoolean.True;
    textEdit1.Properties.AdvancedModeOptions.AutoCompleteMode = DevExpress.XtraEditors.TextEditAutoCompleteMode.SuggestAppend;
    // Enable custom auto-complete suggestions.
    textEdit1.Properties.AdvancedModeOptions.AutoCompleteSource = AutoCompleteSource.CustomSource;
    // Supply the custom auto-complete suggestions.
    textEdit1.Properties.AdvancedModeOptions.AutoCompleteCustomSource = DaysOfTheWeek;
  }
See Also