FilePath Registry Custom Data Source Support in WPF AutoComplete

5 May 20212 minutes to read

AutoComplete can be used with different kinds of Data Source like FilePath, Registry & CustomSource. The Data
Source of the AutoComplete control can be set using the Source property.

When the value of the Source property is set as FilePath, the AutoComplete will displays the path in the local
system as the source. This is illustrated in the following image.

file path support

Source—FilePath

When the value of the Source property is set as Registry, the AutoComplete loads the values from the Registry. It
is used when the Registry keys are required as input. This is illustrated in the image given below.

source registry

Source—Registry

When the value of the Source property is set as Custom, the AutoComplete loads the values from the Business objects
bounded to the AutoComplete control by using the CustomSource property. This is illustrated in the image given
below.

source custom

Source—Custom

Adding data source support to an application

AutoComplete can be used with different kinds of Data Sources using the Source property. This support can be added
to the application as mentioned in the following code example.

<syncfusion:AutoComplete x:Name="AutoComplete1" Source="FilePath"/>
<syncfusion:AutoComplete x:Name="AutoComplete2" Source ="Registry"/>
<syncfusion:AutoComplete x:Name="AutoComplete3" Source="Custom">     
<syncfusion:AutoComplete.CustomSource>             
<local:CustomerListCollection/>     
</syncfusion:AutoComplete.CustomSource>
</syncfusion:AutoComplete>
AutoComplete autoComplete1 = new AutoComplete();
this.autoComplete1.Source = SourceMode.FilePath;

AutoComplete autoComplete2 = new AutoComplete();
this.autoComplete2.SelectionMode = SourceMode.Registry;

AutoComplete autoComplete3 = new AutoComplete();
this.autoComplete3.SelectionMode = SourceMode.Custom;

List<String> products = new List<String>();
customSource.Add("Diagram");
customSource.Add("Gauge");
customSource.Add("Chart");
customSource.Add("Schedule");
customSource.Add("Grid");
customSource.Add("DocIo");
customSource.Add("XlsIo");
customSource.Add("Pdf");
customSource.Add("RichTextBox");
customSource.Add("ReportBuilder");
this.autoComplete3.CustomSource = products;

Tables for properties, methods, and events

Events

WPF Sample Browser-> Tools -> Editors -> AutoComplete Demo