Solved

Double clicking on datagrid cell

Posted on 2003-10-22
3
364 Views
Last Modified: 2012-05-04
How do i raise an event when double clicking on a c# datagridcell. I registered my delegate with the doubleclick event handler but events are only fired if i double click on any part of the grid except the cells, e.g. headers. The cell seems to select its content and swallow the the event. Maybe i do not understand how the datagrid does its event managment. Cells do not seem to have the own event handlers so it figure that the grid should tak responsibility. So Q1: How do i get the event to reach my handler. Q2: How do i turn off the cell content selection when single or double clicking. Perhaps the two are related. In relation to Q2, I have set the cell editing to readonly.

Any answers?

Thanks
Micah
 
public void foo()
{
  this.logTable = new DataGrid();
  this.logTable.ReadOnly = true;
  this.logTable.DoubleClick+=new EventHandler(logTable_DoubleClick);
}

protected void logTable_DoubleClick(object sender, EventArgs args)
{
                  
}

0
Comment
Question by:micahdaniels
3 Comments
 
LVL 18

Accepted Solution

by:
testn earned 125 total points
Comment Utility
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now