Multiple entries in the AutoCompleteBox

For those who don’t know, one of the free controls included in Mindscape WPF Elements is the AutoCompleteBox. The AutoCompleteBox is a type of TextBox that can provide a popup full of input suggestions based on the users current input. The image below is an example of an AutoCompleteBox that displays a list of color names.

AutoCompleteBox with color list

A recent update to the AutoCompleteBox allows users to add multiple individual entries to the text field. Each input generates its own suggestion list. This is much like the email address box in Outlook, Gmail or Hotmail that allows you to input multiple email addresses. To enable this feature, simply set the AutoCompleteBox.MultiInputDelimiters property to be an array of delimiter characters. A good setup for this is a char array containing a comma and a space. This allows users to separate input entries with either a comma, a space or both. Here is some sample code that sets this up:

char[] delimiters = { ',', ' ' };
AutoCompleteBox1.MultiInputDelimiters = delimiters;

Now the user can enter multiple entries side by side and still get full support from the popup suggestion list.

AutoCompleteBox with two entries

See it in action

The popup suggestion list is also displayed if the user goes back and edits any of the input entries as seen below:

AutoCompleteBox - editing an input entry

This feature is available right now from the current nightly builds. You can get the nightly builds for the free edition from the downloads page, or go to your account page if you are already a customer. (The free edition includes a full version of the AutoCompleteBox and several other controls, plus trial versions of 40+ more.)

If you want to know more about the AutoCompleteBox or any of our other controls, then we’d love to hear from you in the forum.

Tagged as WPF Elements

Leave a Reply

Archives

Join our mailer

You should join our newsletter! Sent monthly:

Back to Top