$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Text Box Control for Windows Forms
Highly customizable and themable Text Box Control for Windows Forms C# project
Home > WinForms UI Controls > User Manual > Auto Complete in C#

Auto Completion Mode of Text Box Control

The Kettic Auto Completion Mode of Text Box Control is designed for .NET UI Designers to easily complete the input string such as URLs, addresses, file names or commands etc. There are various powerful features of the Auto Completion Box Control, such as the different layout modes, auto-complete in bound and unbound mode of Outlook style, theming mechanism and customizable appearance, selection and navigation, localizable context menu, and flexible and intuitive API.

Auto Completion Modes of Text Box

The following are the four properties of the Auto Complete mode of the Text Box WinForms Control. The completion behavior can be adjusted by changing the AutoCompleteMode property, which will control the items used for auto completion via adding items or connecting to data source
  • None, this mode is used to disable the functionality of automatic completion.
  • Suggest, this mode is able to suggest the drop down list and populate all strings that match the typed string in according to the edit control.
  • Append, this mode is able to append the left string in according to the characters that has been typed by users. It will highlight the appended characters.
  • SuggestAppend, this mode is able to display Suggest and Append completion string.

Data Binding in Auto Completion Mode

The Kettic Auto Complete Text Box Control support many data sources and developers are able to bind the Text Box Control to collections of bindable type sources such as:
  • Data using DataSet and DataTable from a broad data source providers like MS SQL, Oracle, Access, anything accessible through OleDb.
  • Simple types or custom objects like Generic Lists.
  • Implement BindingList or other IBindingList
  • Simple types or custom objects like ArrayList and Array

Data Binding Properties Setting

AutoCompleteDataSource, this property is used to bind the Text Box Control to the specific data source, including databases, web services, or objects as data sources. To set this property, choose it from the Properties window, and display all existing data sources on the form by clicking the drop-down arrow, Use the Add Project Data Source link to add a data source to the Windows Forms project.
AutoCompleteShowMember, this property is used to show specific data in the auto completion drop down list. To set this property, we need to initially configure the data source property, and then set a value for this property from the drop down list in the Properties window.

Auto Complete in Unbound Mode

The following C# code shows how to use auto completion mode without specifying a data source. First, we will populate the items that will be utilized to complete the input string in Kettic Text Box Control. Add the C# code to the Items collection of the Text Box control,

private void AddAutoCompleteItems()
{
this.ketticTextBoxControl.AutoCompleteMode = AutoCompleteMode.Suggest;
KetticListDataItemCollection autoCompleteItems = this.ketticTextBoxControl1.AutoCompleteItems;

autoCompleteItems.Add(new KetticListDataItem("Apple"));
autoCompleteItems.Add(new KetticListDataItem("Banana"));
autoCompleteItems.Add(new KetticListDataItem("Orange"));
autoCompleteItems.Add(new KetticListDataItem("Watermelon"));
autoCompleteItems.Add(new KetticListDataItem("Blueberry"));
}
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls