title: How do I create a dynamic table with rows and columns using the windows 7 platform
body: <p>I am making a app for roller derby that will get information such as bouts , team names and stats. The information is stored in the JSON format. When I eventually get and parse the data i want to arrange in in a format similar to this:   Team1 Team2  Venue Date Result. The amount of rows should be the length of each list of bouts. I am having trouble finding a way to do this in the C# code. Can anyone point me in the right direction.</p>
  
  <p>Edit: I have tried implementing a list box and I am trying to follow the tutorial found here <a href="http://msdn.microsoft.com/en-us/library/cc265158%28v=vs.95%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/cc265158%28v=vs.95%29.aspx</a></p>
  
  <p>When I run the program I get this error message: Error  1   Event handler 'PhoneApplicationPage_Loaded' not found on class 'PhoneApp2.Page1'    c:\users\lewis\documents\visual studio 2010\Projects\PhoneApp2\PhoneApp2\Page1.xaml Roller Derby App</p>
  
  <p>Here is my Xaml for page1</p>
  
  <pre><code>&lt;!--LayoutRoot is the root grid where all page content is placed--&gt;
  &lt;Grid x:Name="LayoutRoot" Background="Transparent"&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="Auto"/&gt;
          &lt;RowDefinition Height="*"/&gt;
      &lt;/Grid.RowDefinitions&gt;
  
      &lt;!--TitlePanel contains the name of the application and page title--&gt;
      &lt;StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"&gt;
          &lt;TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/&gt;
          &lt;TextBlock x:Name="PageTitle" Text="Upcoming Bouts" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Width="297" TextWrapping="NoWrap" FontSize="40" HorizontalAlignment="Left" /&gt;
          &lt;Button Name="Home" Content="Home" Width="310" HorizontalContentAlignment="Center" HorizontalAlignment="Left" Click="Home_Click" /&gt;
      &lt;/StackPanel&gt;
  
      &lt;!--ContentPanel - place additional content here--&gt;
      &lt;Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"&gt;
          &lt;ListBox Height="100" HorizontalAlignment="Left" Margin="544,177,0,0" Name="ListofBouts" VerticalAlignment="Top" Width="460" Loaded="ListofBouts_Loaded"&gt;
              &lt;ListBox.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;StackPanel Orientation="Horizontal"&gt;
                          &lt;TextBlock Padding="5,0,5,0"
                       Text="{Binding Venue}" /&gt;
                          &lt;TextBlock Text="{Binding Team1}" /&gt;
                          &lt;TextBlock Text="{Binding Team2}"/&gt;
                          &lt;TextBlock Text="{Binding Date}"/&gt;
                      &lt;/StackPanel&gt;
                  &lt;/DataTemplate&gt;
              &lt;/ListBox.ItemTemplate&gt;
  
              &lt;/ListBox&gt;
  
      &lt;/Grid&gt;
  &lt;/Grid&gt;
  
  &lt;!--Sample code showing usage of ApplicationBar--&gt;
  &lt;!--&lt;phone:PhoneApplicationPage.ApplicationBar&gt;
      &lt;shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"&gt;
          &lt;shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/&gt;
          &lt;shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/&gt;
          &lt;shell:ApplicationBar.MenuItems&gt;
              &lt;shell:ApplicationBarMenuItem Text="MenuItem 1"/&gt;
              &lt;shell:ApplicationBarMenuItem Text="MenuItem 2"/&gt;
          &lt;/shell:ApplicationBar.MenuItems&gt;
      &lt;/shell:ApplicationBar&gt;
  &lt;/phone:PhoneApplicationPage.ApplicationBar&gt;--&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is the C#</p>
  
  <pre><code>namespace PhoneApp2
  {
    public partial class Page1 : PhoneApplicationPage
    {
      public Page1()
      {
          InitializeComponent();
      }
  
      private void Home_Click(object sender, RoutedEventArgs e)
      {
          NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
      }
  
      private void ListofBouts_Loaded(object sender, RoutedEventArgs e)
      {
          InitializeComponent();
      }
      public class Bouts
      {
          public string Venue { get; set; }
          public string Team1 { get; set; }
          public string Team2 { get; set; }
          public string Date { get; set; }
  
          public Bouts(String venue, String team1, String team2, String date)
          {
  
              this.Venue = venue;
              this.Team1 = team1;
              this.Team2 = team2;
              this.Date = date;
  
          }
      }
  
  
      public class bouts : ObservableCollection&lt;Bouts&gt;
      {
          public bouts()
          {
              Add(new Bouts("Yankee Sadium", "Yankees", "Mets", "March 3"));
              Add(new Bouts("Yankee Sadium", "Yankees", "Mets", "March 3"));
              Add(new Bouts("Yankee Sadium", "Yankees", "Mets", "March 3"));
              Add(new Bouts("Yankee Sadium", "Yankees", "Mets", "March 3"));
  
          }
      }
  
    }
  }
  </code></pre>