title: Nested ListView only displays first selected data
body: <p>I'm trying to make work a nested ListView for days now, but I can't figure out why it only shows the first selected data. Here is some code:
  aspx:</p>
  
  <pre><code>&lt;asp:ListView ID="ListForumCategories" runat="server"&gt;
          &lt;ItemTemplate&gt;
              &lt;div class="accordionButton"&gt;
                  &lt;table&gt;&lt;%--class="Categories"--%&gt;
                      &lt;tr&gt;
                          &lt;td class="CatName"&gt;
                              &lt;%# Eval("CatName") %&gt;
                          &lt;/td&gt;
                          &lt;td class="SubjectNumber"&gt;
                              0
                          &lt;/td&gt;
                          &lt;td class="AllComment"&gt;
                              0
                          &lt;/td&gt;
                          &lt;td class="CreationDate"&gt;
                              &lt;%# Eval("WhenCreated") %&gt;
                          &lt;/td&gt;
                          &lt;td class="LastModification"&gt;
                              &lt;%# Eval("WhenCreated") %&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;
                  &lt;/div&gt;
              &lt;asp:ListView ID="ListSubjectsToCategories" DataSource='&lt;%# Eval("RelatedSubjects") %&gt;' runat="server"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;div class="accordionContent"&gt;&lt;%# Eval("SubjID") %&gt; &lt;%# Eval("SubjectName") %&gt; &lt;%# Eval("WhenCreated") %&gt;&lt;/div&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:ListView&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:ListView&gt;
  </code></pre>
  
  <p>queries</p>
  
  <pre><code>public static List&lt;ForumCategoriesModel&gt; ListForumCategories()
          {
              try
              {
                  return BW_Model.ForumCategories.Select(x =&gt; new ForumCategoriesModel
                  {
                      CatID = x.CatID,
                      CatName = x.CatName,
                      WhenCreated = x.WhenCreated
                  }).ToList();
              }
              catch
              {
                  throw new Exceptions.SomethingWrongException();
              }
          }
  public static List&lt;ForumSubjectsModel&gt; ListForumSubjectByCategoryID(int catid)
          {
              try
              {
                  return BW_Model.ForumSubjects.Select(x =&gt; new ForumSubjectsModel
                  {
                      SubjID = x.SubjID,
                      WhoCreated = x.WhoCreated,
                      WhichCategory = x.WhichCategory,
                      SubjectName = x.SubjectName,
                      SubjectText = x.SubjectText,
                      WhenCreated = x.WhenCreated
                  }).Where(x =&gt; x.WhichCategory == catid).ToList();
              }
              catch
              {
                  throw new Exceptions.SomethingWrongException();
              }
          }
  </code></pre>
  
  <p>class</p>
  
  <pre><code>public class ForumCategoriesModel
      {
          public Int32 CatID { get; set; }
          public String CatName { get; set; }
          public DateTime WhenCreated { get; set; }
          public List&lt;ForumSubjectsModel&gt; RelatedSubjects { get { return bw_forum_sqlchannel.ListForumSubjectByCategoryID(CatID); } }
      }
  public class ForumSubjectsModel
      {
          public Int32 SubjID { get; set; }
          public Int32 WhoCreated { get; set; }
          public Int32 WhichCategory { get; set; }
          public String SubjectName { get; set; }
          public String SubjectText { get; set; }
          public DateTime WhenCreated { get; set; }
      }
  </code></pre>
  
  <p>I should get a List&lt;> back, with lots of elements, but it only displays the first one for each category.</p>
  
  <p>Trying to solve this for 2 days now... if you could help me out, that would be really appriciated. Thanks in advance.</p>
  
  <p>ah and forgot the behind code :):</p>
  
  <pre><code>categories = bw_forum_sqlchannel.ListForumCategories();
  ListForumCategories.DataSource = categories;
  ListForumCategories.DataBind();
  </code></pre>
  
  <p>the solution:</p>
  
  <pre><code>&lt;asp:ListView ID="ListSubjectsToCategories" DataSource='&lt;%# Eval("RelatedSubjects") %&gt;' runat="server"&gt;
                      &lt;ItemTemplate&gt;
                          &lt;div class="accordionContent"&gt;&lt;%# Eval("SubjID") %&gt; &lt;%# Eval("SubjectName") %&gt; &lt;%# Eval("WhenCreated") %&gt;&lt;/div&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:ListView&gt;
  </code></pre>
  
  <p>became:</p>
  
  <pre><code>&lt;div class="accordionContent"&gt;
  &lt;asp:ListView ID="ListSubjectsToCategories" DataSource='&lt;%# Eval("RelatedSubjects") %&gt;' runat="server"&gt;
                      &lt;ItemTemplate&gt;
                          &lt;%# Eval("SubjID") %&gt; &lt;%# Eval("SubjectName") %&gt; &lt;%# Eval("WhenCreated") %&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:ListView&gt;
  &lt;/div&gt;
  </code></pre>