views:

28

answers:

1

I have a databound dropdownlist, bound to an object datasource. I want to have a default value of "None" inserted at the top of the list and I would like to do this declaritively if possible. After much googling I came up with the below code. However it does not display my default item. I was under the impression that setting the AppendDataBoundItems to True would solve this, however it hasn't.

<asp:DropDownList runat="server" ID="ddl" DataSourceID="ldsCompany" DataTextField="CompanyName" DataValueField="CompanyId" SelectedValue='<%# Bind("CompanyId") %>' AppendDataBoundItems="True">
                    <asp:ListItem Value="DefaultValue" Text="DefaultText"/>
                </asp:DropDownList>
A: 

I just recreated the page and it started working, I obviosuly has some silly error which I missed.

Nicholas