Formview dropdownlist won't populate in insert mode, but does in edit mode ???

J

jobs at webdos

I have a formview that will either edit or insert records into a
database. when I call the page with a query string ?x= its goes to edit
mode and loads data from a datasource in the form and load data into
the dropdown (from another datasource) with no problem.

I'm using the same dropdownlist tag for both edit and insert, however
the dropdown only get populated in insert mode...

<asp:DropDownList ID="RouteCodeList" runat="server" SelectedValue='<%#
Bind("routeCode") %>' DataTextField="routeCode" DatasourceID=
"SQLRouteCodes">

</asp:DropDownList><br />



I've tried adding AppendDataBoundItems=true , and have tried replacing
the selectedvalue with ="", in insert mode it simply does not load the
entries.



Also, I've tried loading entries using findcontrol, but that gives me
an instance error tell me I need to specify new. I've tried Item(0) and
row..

CType(RateFormView.FindControl("RouteCodeList"),
DropDownList).Items.Add("xxx")

Anybody, starting a formview in insert mode and populating a dropdown
beforehand? How?



Thanks.
 

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
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top