Home All Groups Group Topic Archive Search About
Author
13 May 2005 11:43 PM
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...

Author
14 May 2005 7:24 AM
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

Show quoteHide quote
"abcd" <a***@abcd.com> wrote in message
news:%23yxUcWBWFHA.3076@TK2MSFTNGP12.phx.gbl...
>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...
>
>
Author
16 May 2005 8:40 PM
abcd
wonderful this solved the issue.

thanks


Show quoteHide quote
"Fred Hirschfeld" <a@b.c> wrote in message
news:untKAYFWFHA.2660@TK2MSFTNGP10.phx.gbl...
> 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
>
> "abcd" <a***@abcd.com> wrote in message
> news:%23yxUcWBWFHA.3076@TK2MSFTNGP12.phx.gbl...
>>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...
>>
>>
>
>