Results 1 to 22 of 22

Thread: [RESOLVED] Filtering WPF viewsource versus winforms bindingsource

Threaded View

  1. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Location
    Burlington, ON, Canada
    Posts
    343

    Re: Filtering WPF viewsource versus winforms bindingsource

    okay, almost there - here's what i have in window_activated:

    Code:
    If accesslevel = True Or canseeall = True Then
        cbCompanyName.Items.Filter = Nothing
    Else
        cbCompanyName.Items.Filter = New Predicate(Of Object)(AddressOf FilterCompanies)
    End If
    and the function:

    Code:
    Public Function FilterCompanies(ByVal item As Object) As Boolean
            If DirectCast(CurrentItem, CompanyName).Territory = territory Then
                Return True
            Else
                Return False
            End If
    End Function
    i'm erroring out on "currentitem is not declared and a second error of of type 'companyname' is not defined.

    The combobox is databound, and is displaying the company name field and that table also has a field in it called territory - the public variable territory is what i am trying to filter the table on against the territory field in the table......
    Last edited by trevorjeaton; Sep 30th, 2010 at 11:06 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width