title: Windows Store App writing sqlite query into the listview's textblocks
body: <p>i am developing windows store application. I am using sqlite database and i want to put the result of select query into listview. My listview has grids, and textboxes inside these grids. But however i cannot target these textboxes in c# when i gave name to them. Here is the code sample from project:
  First sqlite query:</p>
  
  <pre><code>private void Page_Loaded(object sender, RoutedEventArgs e)
  {
      string DBPath = string.Empty;
      DBPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "mydb.s3db");
  
      using (var db= new SQLite.SQLiteConnection(DBPath))
      {
          var query= db.Table&lt;company&gt;();
          var result= query.ToList();
  
          foreach( var x in result )
          {
              company frm= new company();
              //addition to listview...
          }
      }
  
  }
  </code></pre>
  
  <p>Everything works perfectly above except typing into listview. I have tested it with textblocks outside the listview. </p>
  
  <p>and xaml:</p>
  
  <pre><code>&lt;ListView Name="lv" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10,10,10,10" Grid.Row="3" Grid.RowSpan="11" Grid.ColumnSpan="8"&gt;
      &lt;ListView.HeaderTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;Grid Loaded="gHeader_Loaded"&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                  &lt;/Grid.RowDefinitions&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="0" Text="company no" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="1" Text="company name" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="2" Text="phone" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="3" Text="fax" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="4" Text="address" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="5" Text="state" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="6" Text="city" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;ComboBox Grid.Row="2" Grid.Column="7"  HorizontalAlignment="Center" VerticalAlignment="Center"&gt;
                      &lt;ComboBoxItem Content="test1"&gt;&lt;/ComboBoxItem&gt;
                      &lt;ComboBoxItem Content="test2"&gt;&lt;/ComboBoxItem&gt;
                      &lt;ComboBoxItem Content="test3"&gt;&lt;/ComboBoxItem&gt;
                      &lt;ComboBoxItem Content="test4"&gt;&lt;/ComboBoxItem&gt;
                      &lt;ComboBoxItem Content="test5"&gt;&lt;/ComboBoxItem&gt;
                  &lt;/ComboBox&gt;
              &lt;/Grid&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListView.HeaderTemplate&gt;
      &lt;ListView.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;Grid Loaded="gHeader_Loaded"&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition /&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                      &lt;RowDefinition /&gt;
                  &lt;/Grid.RowDefinitions&gt;
                  &lt;TextBlock x:Name="test" Grid.Row="2" Grid.Column="0" Text="" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="1" Text="" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="1" Text="" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="1" Text="" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="2" Text="" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="3" Text="" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="4" Text="" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                  &lt;TextBlock Grid.Row="2" Grid.Column="5" Text="" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
              &lt;/Grid&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListView.ItemTemplate&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>Sorry for the long post, i wanted to give detailed information about the program then maybe you can see what went wrong. I would appreciate any help/feedback on this. </p>
  
  <p>My regards...</p>