|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
dropwon list questionI 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... 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... > > 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... >> >> > >
Dynamically Adding Controls
HELP!! Dynamically created webcontrol not accessible on postback User Controls Datagrid ... is this the control from hell? What is .Net equivilent of Fieldset/Legend DropDownlist and sorting Loading html file into panel Best free/cheap Menu Control for 1.1 Staggering Data using DataList, Repeater, etc... Repeater and RadioButton |
|||||||||||||||||||||||