467,858 Members | 1,334 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,858 developers. It's quick & easy.

formview dropdownlist when datasource finds no rows

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.

Oct 9 '06 #1
  • viewed: 877

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by P. Yanzick | last post: by
3 posts views Thread by Bas Paap | last post: by
1 post views Thread by Trev | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.