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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:07:29+00:00 2026-06-03T07:07:29+00:00

In windows form application our data grid view has lots of event like row

  • 0

In windows form application our data grid view has lots of event like row mouse double click or row click and extra …

But in WPF i cant find these event .
How can i add row mouse double click to my user control that has a data grid in it

i did it with some bad way that i used data grid mouse double click event and some bug happened in this way but i want know simple and standard way

i also add double click event to data grid items in row_load event but it seems make my program slow if data grid has big source

private void dataGrid1_LoadingRow(object sender, DataGridRowEventArgs e)
{
    e.Row.MouseDoubleClick += new MouseButtonEventHandler(Row_MouseDoubleClick);
}
  • 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-03T07:07:31+00:00Added an answer on June 3, 2026 at 7:07 am

    You can handle the double-click on the DataGrid element, then look at the event source to find the row and column that was clicked:

    private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
    {
        DependencyObject dep = (DependencyObject)e.OriginalSource;
    
        // iteratively traverse the visual tree
        while ((dep != null) && !(dep is DataGridCell) && !(dep is DataGridColumnHeader))
        {
            dep = VisualTreeHelper.GetParent(dep);
        }
    
        if (dep == null)
            return;
    
        if (dep is DataGridColumnHeader)
        {
            DataGridColumnHeader columnHeader = dep as DataGridColumnHeader;
            // do something
        }
    
        if (dep is DataGridCell)
        {
            DataGridCell cell = dep as DataGridCell;
            // do something
        }
    }
    

    I describe this in detail in this blog post that I wrote.

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

Sidebar

Related Questions

I create windows form application using MVP design pattern. Example: IViewInterface view = new
I have a C# Windows Form application that contains a menu with this event:
I am working with Windows form application. In that I retrieve the data from
I want to create a windows form application that will sit on our local
I am creating a VC++2008 Windows Form Application which needs some classes from our
Windows form application. C# 4.0. Basically I have two datagridviews dgv1 and dgv2. One
Windows Form Application – Manipulating input-elements in WinForm WebBrowser Although I am familiar with
I am developing Windows Form Application using Microsoft Visual C# 2010 I have two
I am developing a Windows Form Application against a SQL Server relational database. An
There is a windows form application which i am trying to convert to wpf

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.