title: How to get parent datasource Eval() inside a nested Repeater?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1411336/accessing-parent-data-in-nested-repeater-in-the-headertemplate">Accessing parent data in nested repeater, in the HeaderTemplate</a>  </p>
  </blockquote>
  
  
  
  <p>I have a nested repeater being databound... let's say the top level repeater is an OrderRow and the inner repeaters are bound to LineItem rows from my DB.  ASPX is something like this:</p>
  
  <pre><code>&lt;asp:Repeater ID="rptOrder" runat="server"&gt;
      &lt;ItemTemplate&gt;
          &lt;%# Eval("OrderID") %&gt;:&lt;br/&gt;
          &lt;asp:Repeater ID="rptLineItems" runat="server"&gt;
              &lt;ItemTemplate&gt;
                  &lt;%# Eval("SomeColumn1"); %&gt;
                  &lt;%# Eval("SomeColumn2"); %&gt;
                  &lt;%# Eval("SomeColumn3"); %&gt;
              &lt;/ItemTemplate&gt;
              &lt;FooterTemplate&gt;
                  &lt;asp:Button ID="btnAddLine" runat="server" CommandArgument=&lt;%# ???? %&gt; /&gt;
              &lt;/FooterTemplate&gt;
          &lt;/asp:Repeater&gt;
      &lt;/ItemTemplate
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>Now the button on the inner footer will be used to add a new line item... but the command argument needs to be the OrderID from the outer repeater, so we know which order to add to.  Obviously a regular Eval() call won't work here, because it will have the inner repeater's DataRowView as a source [actually, it won't, since it's in the footer].  How do I get this value?  Am I going to have to set this dynamically in the ItemDataBound event of the outside repeater?</p>