Solved

Double clicking on datagrid cell

Posted on 2003-10-22
3
366 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
ID: 9602691
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

20 Experts available now in Live!

Get 1:1 Help Now