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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top