I have a asp.net dropdown list that populates from a sqldatasource. My issue is that the first option needs to be (All). Is there anyway to add this extra option to the list before the eqldatasource list?
<asp:DropDownList ID="REGIONS" runat="server"
Width="70px" AutoPostBack="True" DataTextField="REGION_CD"
DataValueField="REGION_CD" DataSourceID="SqlDataSource1" >
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:PRODUCTION %>"
ProviderName="<%$ ConnectionStrings:PRODUCTION.ProviderName %>"
SelectCommand="select distinct(region_cd) from mv_gauge_filter_dist where region_cd is not null">
</asp:SqlDataSource>
Thanx!
Not tested, but this should work:
Make note of the AppendDataBoundItems=”true”…