title: How to set the text of textblock present inside a datatemplate of a listbox from c# codebehind?
body: <p>My listbox XAML looks like this:</p>
  
  <pre><code>&lt;ListBox x:Name="lstbxbProducts" SelectionChanged="lstbxbProducts_SelectionChanged_1" HorizontalAlignment="Left" Height="547" Margin="0,221,0,0" VerticalAlignment="Top" Width="1044" RenderTransformOrigin="0.600000023841858,0.5"&gt;        
      &lt;ListBox.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;StackPanel Orientation="Horizontal"&gt;
                  &lt;StackPanel Width="80" VerticalAlignment="Center" Orientation="Horizontal"&gt;
                      &lt;TextBlock Text="{Binding prdnum}" VerticalAlignment="Center" HorizontalAlignment="Left" &gt;&lt;/TextBlock&gt;
                      &lt;TextBlock Text="  -" VerticalAlignment="Center" HorizontalAlignment="Left" &gt;&lt;/TextBlock&gt;
                  &lt;/StackPanel&gt;
                  &lt;StackPanel Width="400"&gt;
                      &lt;TextBlock Text="{Binding prddsc}" VerticalAlignment="Center"  HorizontalAlignment="Left" &gt;&lt;/TextBlock&gt;
                  &lt;/StackPanel&gt;
                  &lt;StackPanel Orientation="Horizontal" VerticalAlignment="Center" Width="180"&gt;
                      &lt;StackPanel&gt;
                          &lt;TextBlock Text="{Binding um_cod}" Name="txtblkUmcode" VerticalAlignment="Center"  HorizontalAlignment="Left" &gt;&lt;/TextBlock&gt;
                      &lt;/StackPanel&gt;
                      &lt;StackPanel Width="20"&gt;&lt;/StackPanel&gt;
                      &lt;StackPanel Width="20"&gt;
                          &lt;Image Source="/Images/Arrowselection.png" Tapped="Image_Tapped_1" VerticalAlignment="Center" &gt;&lt;/Image&gt;
                      &lt;/StackPanel&gt;
                  &lt;/StackPanel&gt;
  
                  &lt;StackPanel Width="180"&gt;
                      &lt;TextBlock Text="{Binding prcby_prc}" VerticalAlignment="Center" HorizontalAlignment="Center" &gt;&lt;/TextBlock&gt;
                  &lt;/StackPanel&gt;
                  &lt;StackPanel Width="100"&gt;
                      &lt;TextBox Text="{Binding stdordqty, Mode=TwoWay}" VerticalAlignment="Center" TextAlignment="Center"   HorizontalAlignment="Right" &gt;&lt;/TextBox&gt;
                  &lt;/StackPanel&gt;
              &lt;/StackPanel&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>I want to set the text of Name="txtblkUmcode" present in my listbox from c# codebhind in this way, but no luck:</p>
  
  <pre><code>TextBlock txtBlk = new TextBlock();
  txtBlk =  lstbxbProducts.FindName("txtblkUmcode") as TextBlock;
  txtBlk .Text = "test";
  </code></pre>
  
  <p>Please let me know how can I:</p>
  
  <ol>
  <li>set the text of that textblock prsent inside a datatemplate of a my listbox ?</li>
  <li>i want to change the text of that textblock of that single listbox item only ?</li>
  </ol>
  
  <p>How can I do this? Please let me know.</p>