dropwon list question

A

abcd

I want to add to dropdown list the first entry as a hard coded entry then
after that I want to add the entries thru Data reader. How can I do
this...when I add listitem and then datasource = dataReader then my hard
coded listitem is overwritten....

any idea...
 
F

Fred Hirschfeld

You must do your data binding first and then add it later...

ddl.DataSource = reader;
ddl.DataBind();
ddl.Items.Insert(0, New ListItem(...)); // to insert
ddl.Items.Add(...); // To append

Fred
 
A

abcd

wonderful this solved the issue.

thanks


Fred Hirschfeld said:
You must do your data binding first and then add it later...

ddl.DataSource = reader;
ddl.DataBind();
ddl.Items.Insert(0, New ListItem(...)); // to insert
ddl.Items.Add(...); // To append

Fred
 

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

Members online

No members online now.

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top