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 1027823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:17:36+00:00 2026-05-16T12:17:36+00:00

I have a DataGrid that has auto generated columns. In side of the AutoColumnsGenerated

  • 0

I have a DataGrid that has auto generated columns. In side of the AutoColumnsGenerated event I am adding an additional column. This column is a DataGridTemplateColumn which includes a DataTemplate with it’s VisualTree set to a CheckBox. I am adding a handler to the CheckBox.ClickEvent in which I will chain a value in the associated row.

If I have multiple DataGrids that are built this way I don’t know how to figure out which listview the click event originated from.

From the click event handler I have access to the check box, but its parent is not set. I have also tried using the visual tee helper, but cannot get into the tree in the correct spot.

Does anybody know how I can find out the corresponding DataGrid that contains the clicked CheckBox?

  • 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-05-16T12:17:36+00:00Added an answer on May 16, 2026 at 12:17 pm

    VisualTreeHelper should work. Try the following code on the event handler:

    FrameworkElement fe = sender as FrameworkElement;
    
    while ((fe.GetType() != typeof(DataGrid)) &&
           (fe != null))
    {
         fe = VisualTreeHelper.GetParent(fe) as FrameworkElement;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a wpf datagrid that has it's columns generated dynamically in code and
I have a DataGrid component that displays a few columns of data. It has
I have a DataGrid that has event handlers bound to SortCommand and PageIndexChanged .
Hi I have a datagrid that has a number of datagridtemplate columns that are
I have the following code working with a DataGrid that has two column Column_A
I have a DataGrid that has between 4-10 columns. I want the columns to
I have a SL DataGrid that has two columns. I need to be able
I have a Silverlight 5 Datagrid that has a checkbox in the first column.
I have a datagrid column that has Hyperlinkbuttons. You have to click the button
I'm working on creating a datagrid that has a checkbox column. I have some

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.