LimitToList Property

Specifies whether to restrict the input to items in the items source. Default value is False.
Public Property LimitToList As Boolean
public bool LimitToList {get; set;}

LimitToList is used to restrict the user input to drop-down items. If the user enters text that doesn't have a matching item in the underlying items collection, the IsValueValid property will be set to False. When the user attempts the leave the editor with such a value, EditModeValidationError event is raised and by default an error message is displayed to the user. This behavior can be controlled by the InvalidValueBehavior property.

Note that the matching item is found by searching drop-down items for an item that has the same display text (based on the DisplayMemberPath) as what the user has entered in the editor. If a matching is item is found, the Value, Text, SelectedIndex and SelectedItem will be updated to reflect the matching item. If no matching item is found, the Value property will retain its previous value. The Text property will reflect the entered text, SelectedItem will be set to null and SelectedIndex will be set to -1.


Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also