473,394 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Problem binding DropDownlist

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

--
Thanks
Regards.
Josema
Nov 16 '05 #1
2 1257
Insert 'Choose Option' after data binding.

"Josema" <Je******@ocu.org> wrote in message
news:DA**********************************@microsof t.com...
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).

--
Thanks
Regards.
Josema
Nov 16 '05 #2
Thanks Shiva...
Kind Regards.
Josema.

"Shiva" wrote:
Insert 'Choose Option' after data binding.

"Josema" <Je******@ocu.org> wrote in message
news:DA**********************************@microsof t.com...
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).

--
Thanks
Regards.
Josema

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Christian | last post by:
Hi, I have a datagrid on an ASP.NET page, which has a custom columntemplate. In this columntemplate I would like to have a DropDownList, which is shown, when the user edits the record....
1
by: Harold | last post by:
Hi all, having a little difficulty binding up a dropdownlist control in a datagrid column. I know I must be missing something Here are 2 methods. One is the DataGrid's ItemDataBound event to catch...
2
by: RAMADU | last post by:
Hi There is a ListItemCollection containing ListItems (of course), each of whose Value and Text properties have been set. The Value and Text's values are different i.e. ListItem.Text = "Name0"...
4
by: wolfgang wagner | last post by:
hi all! after successfully integrating a dropdownlist in my datagrid i have another problem: i cannot set the selected index of the dropdownlistbox. here is my code: hardware.aspx...
5
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
0
by: Daniel Doyle | last post by:
Hello and apologies in advance for the amount of code in this post. I've also sent this message to the Sharepoint group, but thought that ASP.NET developers may also be able to help, even though...
9
by: Timm | last post by:
I have an ASP.NET 2.0 page with two DropDownLists. I am using declarative data binding wherever possible and trying to minimize the use of code. The list of values in DropDownList DDL2 should be...
10
by: ads | last post by:
hi, after binding the dropdownlist to a datasource, ive experience this error "Cannot have multiple items selected in a dropdownlist" after using the code:...
2
by: Igor | last post by:
Hi I build a page that has a dropdownlist control bound with data from a database. When user select an item from the dropdownlist I want a label to be filled with a result from a stored...
4
by: pankajsingh5k | last post by:
Hi guys, These question is for all the experts... Please help me before my brain explodes The problem is again with the formview control.. I have a formview and i have to use it that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.