Nevron Open Vision Documentation
Auto Complete Box

The auto complete box is a widget that is made of a text box and optionally an image box. When the user enters some text in the text box of the auto complete box a list box pops up with auto complete suggestions.


After an auto complete box is created it should be initialized through its InitAutoComplete generic method, which accepts an iterable object (e.g. a list) and optionally an auto complete factory. The items in this iterable object will be used to fill the auto complete suggestions shown in the drop down list box when the user modifies the text of the auto complete box. The following code demonstrates how to create and initialize a simple auto complete box:

Auto Complete Box Initialization
Copy Code
// Create a list of countries
NList<string> countries = new NList<string>();
countries.Add("United Arab Emirates");
countries.Add("United Kingdom");
countries.Add("United States");

// Create and initialize the auto complete box
NAutoCompleteBox autoCompleteBox = new NAutoCompleteBox();
autoCompleteBox.PreferredWidth = 150;

After the code is executed the auto complete box will be initialized with the given list of countries, so when you enter "un" for example, the drop down list box will show 3 items - "United Arab Emirates", "United Kingdom" and "United States".

Properties and Events

The auto complete box provides the following properties:

The auto complete box also provides the following events:

ListBoxItemSelected Event Handling
Copy Code
private void OnAutoCompleteBoxListBoxItemSelected(NEventArgs arg)
    INSearchableListBox listBox = (INSearchableListBox)arg.TargetNode;
    object selectedItem = listBox.GetSelectedItem();    
    // Implement your logic depending on the selected item here
Widget Factory

Nevron Open Vision auto complete box lets you fully customize the text and appearance of the drop down list box items. All you have to do is to create a class that inherits NWidgetFactory and pass an instance of it to the InitAutoComplete method of the auto complete box. You can override the following methods of the auto complete factory in order to customize the drop down list box items:

See Also
Send Feedback