Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

FilteredItemsSourceProvider.ItemsSource Property

Gets or sets the collection of items to be filtered. This is a bindable property.

Namespace: DevExpress.Maui.Editors

Assembly: DevExpress.Maui.Editors.dll

NuGet Package: DevExpress.Maui.Editors

#Declaration

C#
public IEnumerable ItemsSource { get; set; }

#Property Value

Type Description
IEnumerable

An object that contains data items.

#Example

The following example populates the AutoCompleteTokenEdit‘s drop-down list with filtered items. This example uses the ItemsEditBase.DisplayMember property to obtain the display text for items:

AutoCompleteTokenEdit - Add items synchronously

<dxe:AutoCompleteTokenEdit x:Name="autoCompleteTokenEdit" DisplayMember="Name">
    <dxe:AutoCompleteTokenEdit.BindingContext>
        <local:AutoCompleteTokenEditViewModel/>
    </dxe:AutoCompleteTokenEdit.BindingContext>
    <dxe:AutoCompleteTokenEdit.ItemsSourceProvider>
        <dxe:FilteredItemsSourceProvider ItemsSource="{Binding ItemsSource}"
                                         FilterCondition="Contains"
                                         FilterComparisonType="CurrentCultureIgnoreCase"
                                         FilterMembers="Name, Capital"/>
    </dxe:AutoCompleteTokenEdit.ItemsSourceProvider>
</dxe:AutoCompleteTokenEdit>
C#
public class State {
    public string Name { get; set; }
    public string Abbr { get; set; }
    public string Capital { get; set; }
}

public class AutoCompleteTokenEditViewModel : INotifyPropertyChanged {
    ObservableCollection<State> itemsSource = new ObservableCollection<State>();
    public ObservableCollection<State> ItemsSource { get { return itemsSource; } set { itemsSource = value; OnPropertyChanged(nameof(ItemsSource)); } }
    public AutoCompleteTokenEditViewModel() {
        ItemsSource.Add(new State() { Name = "California", Abbr = "CA", Capital = "Sacramento" });
        ItemsSource.Add(new State() { Name = "Colorado", Abbr = "CO", Capital = "Denver" });
        ItemsSource.Add(new State() { Name = "Connecticut", Abbr = "CT", Capital = "Hartford" });
    }
    public event PropertyChangedEventHandler PropertyChanged;
    protected void OnPropertyChanged(string propertyName) {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}
See Also