IBindingList.SupportsSearching Property


Gets whether the list supports searching using the Find method.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

bool SupportsSearching { get; }

Property Value

Type: System.Boolean

true if the list supports searching using the Find method; otherwise, false.

The following code example demonstrates how to implement the SupportsSearching property.

    public class MyFontList : BindingList<Font>

        protected override bool SupportsSearchingCore
            get { return true; }
        protected override int FindCore(PropertyDescriptor prop, object key)
            // Ignore the prop value and search by family name.
            for (int i = 0; i < Count; ++i)
                if (Items[i].FontFamily.Name.ToLower() == ((string)key).ToLower())
                    return i;

            return -1;



.NET Framework
Available since 1.1
Return to top