formview dropdownlist when datasource finds no rows

J

jobs at webdos

My challenge is I need to populate a formview's dropdownlist even when
my datasource does not find a record to bind with. I'm trying to avoid
binding in the codebehind.



This code works works fine when ratedatasource finds a row, but when it
doesnot my dropdowns dont get popultated. Keep in mind I have two
datasources, one for the form the other for my dropdownlist.

<asp:FormView ID="RateFormView" runat="server"
DataSourceID="RateDataSource" DefaultMode="Insert" SkinID="FormView">


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

</asp:DropDownList><br />

In the insertitemtemplate, I the dropdowns don't populate at all unless
I force them in on the codebehind.
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top