Hi,
you need the following:-
Protected Overrides ReadOnly Property SupportsSearchi ngCore() As Boolean
Get
Return True
End Get
End Property
then implement FindCore with your search
hint:
compare the PropertyDescrip tor.GetValue with the property you are sorting
against
finally implement a GetItem (or similar) method something like:-
Public Function GetItem(ByVal ColumnName As String, ByVal ColumnValue As
Object) As T
Dim properties As PropertyDescrip torCollection =
TypeDescriptor. GetProperties(M e.Items(0).GetT ype)
Dim myProperty As PropertyDescrip tor = properties.Find (ColumnName,
False)
Dim i As Integer = FindCore(myProp erty, ColumnValue)
If i = -1 Then
Return Nothing
Else
Return Me.Item(i)
End If
End Function
"Pieter" wrote:
Hi,
I have my own custom BindingList, that inherits from BindingList, and
implements IComponent.
I would like to implement a Find-method, that will allow me to search for a
property of my Items.
So basicly: If my Items in the List have a property Name, I would like to be
able to return with this method all the items that have Name = 'Bill Gates'
etc.
Any idea how I should implement this? Any hints, links, samples would be
really appreciated.
Thanks a lot in advance,
Pieter