Posted By

derebus on 10/12/10


Tagged

add item DropDownList databind


Versions (?)

Add default value for dropdownlist


 / Published in: VB.NET
 

URL: http://digitalcolony.com/2007/03/add-item-to-dropdownlist-after-databind.aspx

Add Item to DropDownList After DataBind

  1. ddlAuthor.DataTextField = "FullName"
  2. ddlAuthor.DataValueField = "AuthorID"
  3. ddlAuthor.DataSource = authorDB.GetAuthors()
  4. ddlAuthor.DataBind()
  5. 'ERROR ---> ddlAuthor.Items.Insert(0, "-- Select Author --")
  6. ddlAuthor.Items.Insert(0, New ListItem("-- Select Author --", "0"))

Report this snippet  

You need to login to post a comment.