In gridView I have dropdown list :
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="ProductID" HeaderText="ProductID" InsertVisible="False"ReadOnly="True" SortExpression="ProductID" />
<asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" />
<asp:TemplateField HeaderText="dropdown">
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2" DataTextField="CustomerName" DataValueField="CustomerID">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="SELECT [ProductID], [ProductName] FROM [Alphabetical list of products]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" FilterExpression="ProductID='{0}'" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="SELECT [CustomerName], [CustomerID] FROM [Invoices] " >
<FilterParameters>
<asp:ControlParameter Name="Title" DefaultValue="0"/>
</FilterParameters>
</asp:SqlDataSource>
Now, I would like to filter the sqlDataSource for dropdown list, to fill only that rows into dropdown which has productID equal to the productID of the row, where the dropdown is placed.
(so, sqlDataSource is fileterd dynamically for each row)
I was trying to do that with select parameter but no success. Now, I'm trying to do that with Filter parameter but also got stock.
Any example, idea, help?
Thanks,S