Groups | Blog | Home
all groups > asp.net webcontrols > may 2005 >

asp.net webcontrols : dropwon list question


abcd
5/13/2005 4:43:47 PM
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...

Fred Hirschfeld
5/14/2005 12:24:40 AM
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

[quoted text, click to view]

abcd
5/16/2005 1:40:15 PM
wonderful this solved the issue.

thanks


[quoted text, click to view]

AddThis Social Bookmark Button