I have a DropDownList as a TemplateField in a DetailsView. I want to populate this DropDownList with all possible options that will be pulled from one SqlDataSource while assigning the selected value of the DropDownList to the current value coming from the SqlDataSource that the DetailsView is bound to. So something like:
<asp:DetailsView DataSourceID="SqlDataSource1">
<asp:TemplateField>
<asp:DropDownList ID="Serial">
/* Here is where I need to bind the dropdown to data source 2 so that All serials are available while selecting it's current value from data source 1.
</asp:TemplateField>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1"
SelectCommand = "Select SerialNumber From Equipment Where EquipID = @EquipID">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" DefaultValue=""
Name="EquipID" PropertyName="SelectedDataKey.Values[EquipID]" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2"
SelectCommand = "Select SerialNumber From Equipment">
</asp:SqlDataSource>