title: Accessing TextBlock in a grid with LINQ
body: <p>I am dynamically generating rows in a XAML grid:</p>
  
  <pre><code>        for (int i = 0; i &lt; AssociatedSteps.Length; i++)
          {
              //if (i == 0 || AssociatedSteps[i].OriginPkg != AssociatedSteps[i-1].OriginPkg)
              //{
              //Define new Row to add
              RowDef = new RowDefinition();
              RowDef.Height = new GridLength(60);
  
              //Add row definition to Grid
              WorkPackageViewResults.RowDefinitions.Add(RowDef);
  
              //Define the control that will be added to new row
              Text1 = new TextBlock();
              Text1.Text = AssociatedSteps[i].SF01;
              Text1.Width = Settings.workPackageColumn5Width;
              Text1.TextAlignment = TextAlignment.Center;
  
              Text2 = new TextBlock();
              Text2.Text = AssociatedSteps[i].SF10;
              Text2.Width = Settings.workPackageColumn5Width;
              Text2.TextAlignment = TextAlignment.Center;
  
              Text3 = new TextBlock();
              Text3.Text = AssociatedSteps[i].OriginPkg;
              Text3.Width = Settings.workPackageColumn5Width;
              Text3.TextAlignment = TextAlignment.Center;
  
              Button1 = new Button();
              Button1.Content = AssociatedSteps[i].Description;
              Button1.Width = Settings.workPackageColumn5Width;
              Button1.Click += new RoutedEventHandler(ProgressUpdateButton_Click);
              Button1.Tag = AssociatedSteps[i].StepID;
  
              //create stackpanel and define which row to add the stackpanel to
              StackP = new StackPanel();
              //StackP.Background = new SolidColorBrush(Colors.Wheat);
              StackP.SetValue(Grid.RowProperty, i);
              StackP.Orientation = Orientation.Horizontal;
              StackP.Margin = new Thickness(0, 0, 0, 0);
  
              PercentComplete = new TextBlock();
              PercentComplete.Text = (Convert.ToDouble(AssociatedSteps[i].ToDateQty) / Convert.ToDouble(AssociatedSteps[i].MTOQty)).ToString();
              PercentComplete.Width = Settings.workPackageColumn5Width;
              PercentComplete.TextAlignment = TextAlignment.Center;
  
              //add your control to the stackpanel
              StackP.Children.Add(Text1);
              StackP.Children.Add(Text2);
              StackP.Children.Add(Text3);
              StackP.Children.Add(Button1);
              StackP.Children.Add(PercentComplete);
              //add the stackpanel to the grid
              WorkPackageViewResults.Children.Add(StackP);
          }
  </code></pre>
  
  <p>I'm trying to use LINQ to get access to the grid being programatically updated above:</p>
  
  <pre><code>&lt;Grid Name="WorkPackageViewResults"&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/aRBOU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aRBOU.png" alt="enter image description here"></a></p>
  
  <p>I'm not seeing they type of options you would for a cell. I want to to access a particular rows PercentComplete TextBlock so I can update the text. How do I accomplish this?</p>