Results 1 to 3 of 3

Thread: Listbox help ## RESOLVED ##

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2004
    Posts
    59

    Listbox help ## RESOLVED ##

    Hello

    I have 2 Listboxes, both are bound to two different tables.

    How do I filter the list items in the second listbox by selecting something in the first list box?

    For example, in the first listbox I have user names, if I click a username, I want the second list box to display the appropriate department this person is in.

    Can this be done.

    Thanks
    Last edited by narmi2; Jul 4th, 2004 at 10:34 AM.

  2. #2
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    I use a DataView to Filter the DataSet Results: Something like:

    Code:
    Dim dv As DataView = New DataView(ds.Tables(0))
    
    dv.RowFilter = "username=" & Listbox1.SelectedValue
    
    ListBox2.datasource = dv
    ListBox2.databind
    ~Ryan





    Have I helped you? Please Rate my posts.

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2004
    Posts
    59
    thanks

    will be trying that out asap

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