Problem binding DropDownlist

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a DropDownList called BSDropDown and the following code:

this.BSDropDown.DataSource=B2BSS_;
this.BSDropDown.DataTextField="Name";
this.BSDropDown.DataValueField="ID";
ListItem newitem=new ListItem("choose option","0");
this.BSDropDown.Items.Insert(0,newitem);
this.BSDropDown.DataBind();

My problem is that i only see the things that are in the data source, not
the choose option (this code its in the on init method).
 
Insert 'Choose Option' after data binding.

Hi,

I have a DropDownList called BSDropDown and the following code:

this.BSDropDown.DataSource=B2BSS_;
this.BSDropDown.DataTextField="Name";
this.BSDropDown.DataValueField="ID";
ListItem newitem=new ListItem("choose option","0");
this.BSDropDown.Items.Insert(0,newitem);
this.BSDropDown.DataBind();

My problem is that i only see the things that are in the data source, not
the choose option (this code its in the on init method).
 
Back
Top