Databinding DropDown Control in .Net
问题 I am binding the dropdown with db entity. ddlCustomer.DataSource = Customer.GetAll(); ddlCustomer.DataTextField = "CustomerName"; ddlCustomer.DataBind(); I want to add "SELECT" as the first itemlist in dropdown and bind then entity to the dropdown. How can i do this? 回答1: Add: ddlCustomer.Items.Insert(0, "SELECT"); After ddlCustomer.DataBind(); The item must be inserted after the data bind because the data bind clears the items. 回答2: I don't know if there is a one line solution to this, but