Avtel Telav

Avtel Telav

  • NA
  • 3
  • 0

How to refer to dynamically created TextBlocks later on to update the text?

Mar 28 2010 10:25 PM
Hi,

I used a for-loop to create a number of TextBlocks and add them to a Grid.  Later on, in an Event Handler, I want to refer to these TextBlocks and be able to change the text of either some or all, depending on my need.
The problem I'm having is how to refer to the TextBlocks, which were created using one generic name (txtBox) in common for each instance.  I tried accessing using the txtBox.Name I set during creation, but that doesn't work.
Would appreciate any suggestions. Thanks!

Answers (3)