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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:52:26+00:00 2026-05-26T07:52:26+00:00

In my current implementation, I spawn tabs and grids dynamically. Basically, a new grid

  • 0

In my current implementation, I spawn tabs and grids dynamically.

Basically, a new grid needs to be created by a double click on a any row of a previous grid and use the row data for other provessing.

this.AddHandler(DataGrid.MouseDoubleClickEvent, new RoutedEventHandler    (Generic_DoubleClick));    

This handles for any double click even outside the grid and not specifically for the grid.

I need to find a handler which can return the row values specifically to that grid. Please suggest a workaround or a easier way of doing this.

Thanks.

  • 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-26T07:52:27+00:00Added an answer on May 26, 2026 at 7:52 am

    Handle the double click routed event from datagrid row of the datagrid.

       <tk:DataGrid>
            <tk:DataGrid.Resources>
                <Style TargetType="{x:Type tk:DataGridRow}">
                    <EventSetter Event="MouseDoubleClick"
                                 Handler="DataGridRow_MouseDoubleClick"/>
                </Style>
            </tk:DataGrid.Resources>
            <tk:DataGrid.ItemsSource>
                <x:Array Type="{x:Type TextBlock}">
                    <TextBlock Text="1" Tag="1.1"/>
                    <TextBlock Text="2" Tag="1.2"/>
                    <TextBlock Text="3" Tag="1.3"/>
                    <TextBlock Text="4" Tag="1.4"/>
                </x:Array>
            </tk:DataGrid.ItemsSource>
            <tk:DataGrid.Columns>
                <tk:DataGridTextColumn Header="Text" Binding="{Binding Text}"/>
                <tk:DataGridTextColumn Header="Tag" Binding="{Binding Tag}"/>
            </tk:DataGrid.Columns>
        </tk:DataGrid>
    

    In code behind

        private void DataGridRow_MouseDoubleClick(
               object sender, MouseButtonEventArgs e)
        {
            var dgRow = sender as Microsoft.Windows.Controls.DataGridRow;
            var cellContentElement = e.OriginalSource as UIElement;
        }
    

    Bonus is cellContentElement is the content element of the cell that was double clicked on the row … e.g. in case of DataGridTextColumn it will be TextBlock in the cell.

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

Sidebar

Related Questions

There is a custom implementation of KSPA which needs to be re-written. The current
While browsing through gcc's current implementation of new C++11 headers, I stumbled upon "......"
The current implementation of Remy Sharp's jQuery tag suggestion plugin only checks for matches
My current implementation of an Hash Table is using Linear Probing and now I
I've tried with Postsharp, but their current implementation targets 2.0, and it's getting painful
Paramiko's SFTPClient apparently does not have an exists method. This is my current implementation:
Implementing Equals() for reference types is harder than it seems. My current canonical implementation
A reliable coder friend told me that Python's current multi-threading implementation is seriously buggy
I read that with .NET Framework 4 the current garbage collection implementation is replaced:
The current guidlelines for explicit member implementation recommend: Using explicit members to approximate private

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.