Hi, i have a datagrid from SqlDataSource1 where on 'edit' a ddl is populated by SqlDataSource2. im trying to get the selected value to pass for an update of SqlDataSource1.
<asp:TemplateField HeaderText="CurrentAssignment">
<ItemTemplate>
<%# Eval("CurrentAssignment") %>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList ID="ddlAssignTo" runat="server" DataSourceID="SqlDataSource2" DataTextField="windowslogin" DataValueField="windowslogin")></aspropDownList>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:Test %>"
SelectCommand="SELECT [windowslogin] FROM [AllAssignmentList]order by[windowslogin]">
</asp:SqlDataSource>
</EditItemTemplate>
</asp:TemplateField>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Test %>"
SelectCommand="SELECT [EndorsementID], [CurrentAssignment], [Priority], [Account#]FROM [EndorsementRequests] WHERE ([CurrentAssignment] = @CurrentAssignment) ORDER BY [Account#]"
UpdateCommand="UPDATE EndorsementRequests SET CurrentAssignment = @CurrentAssignment WHERE (EndorsementID = @original_EndorsementID)">
<SelectParameters>
<asparameter DefaultValue="SafeArea" Name="CurrentAssignment" Type="String" />
</SelectParameters>
<UpdateParameters>
<asparameter Name="original_EndorsementID" Type="Int32" />
<asp:ControlParameter Name="CurrentAssignment" ControlID="GridView1$ddlAssignTo" PropertyName="SelectedValue" /></UpdateParameters>
The issues appears to be with the scope since I get a "Could not find control 'GridView1$ddlAssignTo' in ControlParameter 'CurrentAssignment'" error. but i dont see why "GridView1$ddlAssignTo" is not working. thanks for the help
<asp:TemplateField HeaderText="CurrentAssignment">
<ItemTemplate>
<%# Eval("CurrentAssignment") %>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList ID="ddlAssignTo" runat="server" DataSourceID="SqlDataSource2" DataTextField="windowslogin" DataValueField="windowslogin")></aspropDownList>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:Test %>"
SelectCommand="SELECT [windowslogin] FROM [AllAssignmentList]order by[windowslogin]">
</asp:SqlDataSource>
</EditItemTemplate>
</asp:TemplateField>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Test %>"
SelectCommand="SELECT [EndorsementID], [CurrentAssignment], [Priority], [Account#]FROM [EndorsementRequests] WHERE ([CurrentAssignment] = @CurrentAssignment) ORDER BY [Account#]"
UpdateCommand="UPDATE EndorsementRequests SET CurrentAssignment = @CurrentAssignment WHERE (EndorsementID = @original_EndorsementID)">
<SelectParameters>
<asparameter DefaultValue="SafeArea" Name="CurrentAssignment" Type="String" />
</SelectParameters>
<UpdateParameters>
<asparameter Name="original_EndorsementID" Type="Int32" />
<asp:ControlParameter Name="CurrentAssignment" ControlID="GridView1$ddlAssignTo" PropertyName="SelectedValue" /></UpdateParameters>
The issues appears to be with the scope since I get a "Could not find control 'GridView1$ddlAssignTo' in ControlParameter 'CurrentAssignment'" error. but i dont see why "GridView1$ddlAssignTo" is not working. thanks for the help