title: Table In XAml Windows Store App
body: <h2>My TABLE code</h2>
  
  <p>ItemS Control Working Perfectly But I need only one listview inside listview help i get problem in</p>
  
  <h2>c Get Set Class I need a Single List</h2>
  
  <p>Hi I Need To Generate A Table In My Metro APP BUT I GET WRONG OUTPUT PLEASE HELP I BIND HEADER AND CONTENTS SEPERATELY USING LIST</p>
  
  <p>C# CODE</p>
  
  <pre><code> foreach (var item in itemsreceiveds)
          {
              variable2.Add(new contentdata() { firstdata = item.getFirstData, seconddata = item.getSecondData, thirddata = item.getThirdData, headers = item.getFieldName });
          }
          var groupedPersons = variable2.Select((emp) =&gt; new { sectionName = emp.headers }).ToList().Distinct();
           foreach (var s in groupedPersons)
           {
               firstheader = s.sectionName;
               string[] sepword = firstheader.Split('#');
               firstheader = sepword[0].ToUpper();
               secondheader = sepword[1].ToUpper();
               thirdheader = sepword[2].ToUpper();  
               variableheader.Add(new contentdataheader(firstheader,secondheader,thirdheader));
               groupListView.ItemsSource = variableheader;
           }
           //SUBITEM
            foreach (var person in variable2)
           {
               subdata.Add(new subitems(person.firstdata, person.seconddata, person.thirddata));
           }
           itemListViewss.ItemsSource = subdata;
  </code></pre>
  
  <p>XAML</p>
  
  <pre><code>        &lt;ListView Name="groupListView" CanDragItems="True" CanReorderItems="True" AllowDrop="True" IsSwipeEnabled="True" SelectionMode="None" Grid.ColumnSpan="3" Grid.Row="0"&gt;
          &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;StackPanel Orientation="Horizontal" &gt;
                      &lt;Border x:Name="bordermenu" BorderBrush="Black" BorderThickness="1" Grid.Column="1" Grid.Row="0" Width="150"&gt;
                          &lt;TextBlock Foreground="Red" Text="{Binding Firstheader}" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                      &lt;/Border&gt;
                      &lt;Border x:Name="bordermenu2" BorderBrush="Black" BorderThickness="1" Grid.Column="2" Grid.Row="0" Width="150"&gt;
                          &lt;TextBlock Foreground="Red" Text="{Binding Secondheader}" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                      &lt;/Border&gt;
                      &lt;Border x:Name="bordermenu3" BorderBrush="Black" BorderThickness="1" Grid.Column="3" Grid.Row="0" Width="150"&gt;
                          &lt;TextBlock Foreground="Red" Text="{Binding Thirdheader}" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                      &lt;/Border&gt;
                  &lt;/StackPanel&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
      &lt;ListView Name="itemListViewss" CanDragItems="True" CanReorderItems="True" AllowDrop="True" IsSwipeEnabled="True" SelectionMode="None" Grid.ColumnSpan="3" Grid.Row="1"&gt;
          &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;StackPanel Orientation="Horizontal" &gt;
                      &lt;Border x:Name="bordersubmenu" BorderBrush="Black" BorderThickness="1" Grid.Column="1" Grid.Row="1" Width="150"&gt;
                          &lt;TextBlock Foreground="Blue" Text="{Binding dynamic}" x:Name="submenu" HorizontalAlignment="Center" VerticalAlignment="Center"   /&gt;
                      &lt;/Border&gt;
                      &lt;Border x:Name="bordersubmenu2" BorderBrush="Black" BorderThickness="1" Grid.Column="2" Grid.Row="1" Width="150"&gt;
                          &lt;TextBlock Foreground="Blue" Text="{Binding p1}" x:Name="submenu2"  HorizontalAlignment="Center" VerticalAlignment="Center"  /&gt;
                      &lt;/Border&gt;
                      &lt;Border x:Name="bordersubmenu3" BorderBrush="Black" BorderThickness="1" Grid.Column="3" Grid.Row="1" Width="150"&gt;
                          &lt;TextBlock Foreground="Blue" Text="{Binding p2}" x:Name="submenu3" HorizontalAlignment="Center" VerticalAlignment="Center"  /&gt;
                      &lt;/Border&gt;                        
                  &lt;/StackPanel&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
  </code></pre>
  
  <p><strong>I Get Ouput As</strong></p>
  
  <p><img src="https://i.stack.imgur.com/r6ilD.png" alt="I Get Ouput As"></p>
  
  <p><strong>But I Need Output As This</strong></p>
  
  <p><img src="https://i.stack.imgur.com/8OJ3d.png" alt="But I Need Output As This"></p>