Another tip I think you'll enjoy

Results 1 to 2 of 2

Thread: Another tip I think you'll enjoy

  1. #1
    Join Date
    Dec 1969

    Default Another tip I think you'll enjoy

    When we populate drop down lists the initial state shows an item in the list displayed in the textbox. On postback drop down lists you cannot select the item displayed(or the first item in the list for that matter). I&#039;ve heard that some people resolve this problem by putting a blank field in their tables to display a blank initially prior to selection(sloppy and doesn&#039;t really solve the problem completely). Best way to handle this is the set the text of the selected item property to blank:<BR><BR>Me.Dropdownlist1.SelectedItem.Text = ""<BR><BR>This clears the box register and allows you to select the first option in your drop down list for display in your box. You should also consider doing a refresh of the contents of your box because setting the selected item text to blank adds a blank item to your list.<BR><BR>Call DDList(DropdownListID, TableName, FieldName)<BR>Me.DropdownListID.SelectedItem.Text = ""<BR><BR>The call above is in reference to my catch all drop down list routine in a previous message. Check it out!

  2. #2
    Join Date
    Dec 1969

    Default or...

    after a bind you can<BR><BR>DropdownlistID.Items.Insert(0, New ListItem("SELECT SOMETHING", "VALUE"))

Posting Permissions

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