Results 1 to 2 of 2

Thread: DropDownList?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2004
    Location
    cainta
    Posts
    80

    DropDownList?

    Why can't I select any items from my DropDownList(info_cmpycde)?

    Private Sub info_cmpycde_SelectedIndexChanged
    cmpy.text = info_cmpycde.SelectedItem.Value
    or
    cmpy.text = info_cmpycde.SelectedItem.Text
    End Sub

    *cmpy textbox is still null value

  2. #2
    Member basilisk's Avatar
    Join Date
    Jan 2002
    Posts
    32

    Re: DropDownList?

    your sub needs to be

    VB Code:
    1. Private Sub info_cmpycde_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles info_cmpycde.SelectedIndexChanged
    2.         cmpy.Text = info_cmpycde.SelectedItem.Value
    3.  
    4.     End Sub
    if you want the textbox to be updated as soon as you click the drop down list you will also need to set the autopostback=true property of the drop down list

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