Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8834785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:06:22+00:00 2026-06-14T09:06:22+00:00

If i have 9 TextBlock declared on the XAML file like this: <TextBlock Name=cellText_00

  • 0

If i have 9 TextBlock declared on the XAML file like this:

<TextBlock Name="cellText_00" Tag="0"/>
<TextBlock Name="cellText_01" Tag="1"/>
<TextBlock Name="cellText_02" Tag="2"/>
<TextBlock Name="cellText_20" Tag="3"/>
...
<TextBlock Name="cellText_22" Tag="8"/>

There is a way to interact with it from the .cs getting exactly the desired tag element?

For instance is it possible to give all the same name and get it in this way:

TextBlock tb = get(cellText,0);

where the first field is the name and the second one is the tag?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:06:23+00:00Added an answer on June 14, 2026 at 9:06 am

    No, you can’t use the same name for many controls.
    However there is a workaround: using the FindName method:

    http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.findname(v=vs.95).aspx

    There Why can't I access a TextBox by Name with FindName()?
    you can find an example and a solution related to namespaces issues.

    FindName uses a string to retrieve the control. So you can do something like this: FindName("cellText_" + identifier); and take the element you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This global style is declared in App.xaml: <Style TargetType=TextBlock> <Setter Property=FontFamily Value=Times New Roman/>
Lets say i have a TextBlock thats bound to a DateTime, is there any
I have following XAML: <TextBlock HorizontalAlignment=Center VerticalAlignment=Center FontSize=10 FontFamily=Arial Foreground=#414141> <Run Text={Binding LoadsCount} />
Say I have XAML like <TabControl Grid.Row=1 Grid.Column=2 ItemsSource={Binding Tabs} IsSynchronizedWithCurrentItem=True> <TabControl.ItemTemplate> <DataTemplate> <TextBlock
What I have: 1. a textblock in the XAML 2. a query from a
I have a TextBlock that I want to display a user name, and email
I have a DataTemplate with a Combobox inside a ListView like this <GridViewColumn.CellTemplate> <DataTemplate>
I have a TextBlock which is rotated at 90 degrees in the Silverlight XAML:
I have a TextBlock bound to a property. However, I'd like to bold certain
I have a textblock that is bound to an object. This object I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.