hi all,
I have a dropdown list control in <Edit Template>, for new records, I populate this DDL from a sqldatasource control.
In Edit mode, (click Edit link in gridView), i bind data from a Stored Procedure in code behind.
How can i set value from database as Selected in DDL?
this is my afected code:
<EditItemTemplate>
<asp:Label ID="lblFacturarA" runat="server" Text='<%# Eval("facturar_a")%>'>
</asp:Label>
<asp:DropDownList
ID="ddlFacturarA"
CssClass="txt"
runat="server"
DataSourceID="sqlDataSource1"
DataTextField="Zona"
DataValueField="Zona"
AppendDataBoundItems="True"
AutoPostBack="True"
ValidationGroup="rfNewLine">
</asp:DropDownList>
sqldatasource
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DDLGrupoMpw %>"
SelectCommand="usp_GrupoMpw_SELECT" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
this is only for new record
How can i set value from database as default or Selectd in DDL?
thanks for help!!!