Add Default value to Databound Dropdownlist
Now we are going to see how to add Default value to Databound Dropdownlistcontrol
First Case : When user binding the dropdownlist using SqlDataSource so you have to keep in mind to use AppendDatabounditemd="True". then only you can able to add the item manually to Databound Dropdownlist Control
<asp:DropDownList ID="DropDownListFinFile" runat="server" DataSourceID="ObjectDataSourceFinFile" AutoPostBack="True" DataTextField="FinFileName" DataValueField="FinFileId" CssClass="tabletext" AppendDataBoundItems="true">
<asp:ListItem Text="Please select" Value="">-1</asp:ListItem><asp:DropDownList>
0 comments:
Post a Comment
Thanks for the Comments.