title: Binding listview inside listview asp.net c#
body: <p>I want to bind listview inside the listview. I have an object which contains another object list object inside it. </p>
  
  <p>Here I have result object and I have another weeklyresult(List) object in it.
  I am trying to bind outer list with the result object.</p>
  
  <p>Here is the cs code:</p>
  
  <p>Populate data in resultListobject :</p>
  
  <pre><code>                ResultListView.DataSource = resultList;
                  ResultListView.DataBind();
                  Response.Write(resultList);
  </code></pre>
  
  <p>Classes Result and weeklyresult :</p>
  
  <pre><code>class Result {
      public string examDate { get; set; }
      public List&lt;WeeklyResult&gt; weeklyResultList = null;
  }
  
  class WeeklyResult {
      public string subject { get; set; }
      public double marksObtained { get; set; }
      public double outOff { get; set; }
  }
  </code></pre>
  
  <p>Now here is my asp.net code:</p>
  
  <pre><code>&lt;asp:ListView ID="ResultListView" runat="server"&gt;
              &lt;ItemTemplate&gt;
              &lt;asp:Label runat="server"&gt;&lt;/asp:Label&gt;
  
              &lt;table id="Table1" runat="server"&gt;
              &lt;tr&gt;
              &lt;td&gt;Date :&lt;%#Eval("examDate")%&gt; &lt;/td&gt;
              &lt;td&gt;Marks Obtained&lt;/td&gt;
              &lt;td&gt;Out off&lt;/td&gt;
              &lt;/tr&gt; &lt;/table&gt;
  
                  &lt;asp:ListView ID="InnerListView" runat="server"&gt;
                  &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="Label0"  runat="server" Text="abc&lt;%#Eval('weeklyResultList.subject')%&gt;"&gt;&lt;/asp:Label&gt;
                  &lt;asp:Label ID="Label1" runat="server" Text=""&gt;&lt;/asp:Label&gt;
                  &lt;asp:Label ID="Label2" runat="server" Text=""&gt;&lt;/asp:Label&gt;
                  &lt;asp:Label ID="Label3" runat="server" Text=""&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;/asp:ListView&gt;
  
              &lt;/ItemTemplate&gt;
     &lt;/asp:ListView&gt;
  </code></pre>
  
  <p>The data in the outer list is coming but nothing is getting displayed in the inner list.
  Can you please suggest what I am doing wrong.</p>
  
  <p>Thanks,
  Amandeep</p>