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

  • Home
  • SEARCH
  • 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 8776999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:11:20+00:00 2026-06-13T19:11:20+00:00

How to access control in DataGridTemplateColumn to get value ? I’m using this code

  • 0

How to access control in DataGridTemplateColumn to get value ?

I’m using this code :

  <DataGrid HeadersVisibility="None"  Name="dgUser" Grid.Row="0" Grid.Column="0" AutoGenerateColumns="False" ItemsSource="{Binding}"
 CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False">
                                <DataGrid.Columns>
                                    <DataGridTemplateColumn Width="*" Header="" IsReadOnly="True">
                                        <DataGridTemplateColumn.CellTemplate>
                                            <DataTemplate>
                                                <StackPanel Orientation="Horizontal"  Margin="10,0,0,0" Grid.Column="0"  Name="partcount">
                                                    <TextBlock Margin="0,0,5,0" Text="Count"/>
                                                    <TextBox Margin="0,0,5,0" MinWidth="50" Width="Auto" Name="txtcount" Text="{Binding Count}"/>
                                                </StackPanel>
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellTemplate>
                                    </DataGridTemplateColumn>
       </DataGrid.Columns>
                            </DataGrid>

how to access txtcount ?

  • 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-13T19:11:21+00:00Added an answer on June 13, 2026 at 7:11 pm

    You will have to navigate the visual tree to find this element. I wrote a utility class a while back that makes this a little easier, using Linq-to-VisualTree you can find it as follows:

    TextBox tb = dgUser.Descendants<TextBox>()
                       .OfType<TextBox>()
                       .Where(t => t.Name == "txtcount")
                       .Single();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an access control program in Java that captures passwords using JPasswordField
Is there a way to allow multiple cross-domains using the Access-Control-Allow-Origin header? I'm aware
If this were a dynamic response, I'd simply do Response.Headers.Add(Access-Control-Allow-Origin, *); but I have
I'm building a webapp with role based access control using Acegi (Spring) security. So
Using Cloudformation can you set the Authenticated Users group to have put/delete Access Control
I am using the latest version of GlassFish. I want to set the Access-Control-Allow-Origin
I am implementing role based access control using yii framework for the application mentioned
Is there any node.js api for using Windows Azure Access Control from JavaScript (node.js)?
http://boto.s3.amazonaws.com/s3_tut.html#setting-getting-the-access-control-list-for-buckets-and-keys I'm using boto. My friend says it's possible to just generate a temporary
I followed the example: http://arunranga.com/examples/access-control/credentialedRequest.html from this page: http://arunranga.com/examples/access-control/ The example work in Firefox,

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.