title: Nested ListView using two different sqldatasources
body: <p>I have a nested listview</p>
  
  <pre><code>&lt;asp:ListView ID="lst_productsWithDiscounts" DataKeyNames="ProductID" runat="server" DataSourceID="source_discountProducts" ItemPlaceholderID="plc_product" OnItemDataBound="lst_productsWithDiscounts_ItemDataBound"&gt;
  &lt;LayoutTemplate&gt;
      &lt;table&gt;
         &lt;tr&gt;
              &lt;td&gt;Name&lt;/td&gt;
              &lt;td&gt;Price&lt;/td&gt;
              &lt;td&gt;TVA&lt;/td&gt;
              &lt;td&gt;Discount&lt;/td&gt;
              &lt;td&gt;Price&lt;/td&gt;
              &lt;td&gt;New discount&lt;/td&gt;
              &lt;td&gt;New price&lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr id="plc_product" runat="server"&gt;
         &lt;/tr&gt;
      &lt;/table&gt;
  
  
  &lt;/LayoutTemplate&gt;
  &lt;ItemTemplate&gt;
    &lt;tr&gt;
          &lt;td&gt;&lt;%# Eval("ProductCode").ToString()+" / "+ Eval("Name").ToString() %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%# Eval("SellPrice").ToString() %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%# Eval("TVA").ToString() %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%# Eval("Discount").ToString() %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%# BC_Common.Util.Calc(double.Parse(Eval("SellPrice").ToString()),double.Parse(Eval("Discount").ToString()),Convert.ToInt32(Eval("TVA").ToString()),1).ToString() %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%# Eval("NewDiscount").ToString() %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%# BC_Common.Util.Calc(double.Parse(Eval("SellPrice").ToString()), double.Parse(Eval("NewDiscount").ToString()), Convert.ToInt32(Eval("TVA").ToString()), 1).ToString()%&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td colspan="7"&gt;
          &lt;asp:ListView ID="lst_variants" runat="server"  DataSourceID="source_discountVariants" ItemPlaceholderID="plc_variant"&gt;
              &lt;LayoutTemplate&gt;
              &lt;table&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Variant name&lt;/td&gt;
                      &lt;td&gt;&lt;/td&gt;
                      &lt;td&gt;Stock&lt;/td&gt;
                      &lt;td&gt;Reserved&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr id="plc_variant" runat="server"&gt;&lt;/tr&gt;
               &lt;/table&gt;
              &lt;/LayoutTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;td&gt;&lt;%# Eval("Nume").ToString() %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%# Eval("Stock").ToString() %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%# Eval("Reserved").ToString() %&gt;&lt;/td&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:ListView&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/ItemTemplate&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code> protected void lst_productsWithDiscounts_ItemDataBound(object sender, ListViewItemEventArgs e)
      {
          source_discountVariants.SelectParameters["ProductID"].DefaultValue = lst_productsWithDiscounts.DataKeys[e.Item.DataItemIndex]["ProductID"].ToString();
  
          ListView lst_variants = e.Item.FindControl("lst_variants") as ListView;
          lst_variants.DataBind();
  
      }
  </code></pre>
  
  <p>I don't know why but the nested listview (<strong>lst_variants</strong>) is unique for all products and it corresponds with the result for last product from <strong>lst_productsWithDiscounts</strong></p>
  
  <p>So how can I bind the second listview using sqldatasource?</p>