Results 1 to 6 of 6

Thread: Help!!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Location
    Calgary Canada
    Posts
    10

    Help!!!

    Ok this is what I got....
    Two Combo boxes with drop down lists
    First box has company name
    seconds has list of items sold by the company

    PROBLUM
    I want to seclect a company from the first box THEN...
    The drop down list in the second box will Change to have only the companys list that was selected in the first box

    Help I don't have a clue where to start with this
    Thanks
    Thanks
    Moe

  2. #2
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    you can change the source of the second combobox is the first comboboxes SelectedIndexChanged handler

    for exp ...


    Code:
        Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
    
            Select Case ComboBox1.SelectedText
                Case "Company1"
                    ' fill the second combo box by the items sold by company 1
                Case "Company2"
                    ' fill the second combo box by the items sold by company 1
            End Select
        End Sub

  3. #3
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    where is the data coming from? array?dataset? i think its better to use other controls and not the combobox ( of course if you dont have your special reasons to do so )

  4. #4
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    persionboy,

    I'm curious as to why you say it's best to use other control than the combobox. Which control(s)? Why is it better?

    Thanks,
    Mike

  5. #5
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    yeah i got your case confused with one that i was doing in which the treeview worked for me fine in a simular case. sorry for getting you confused

  6. #6
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784
    Hi..

    You can set the sqlconnection , sqladapter to fill the dataset based on your filtering criteria, to load you can use set your combobox's datasource to the dataset ..

    good luck

    Regards
    Winanjaya

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