We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

how to get CellDoubleClick event fired?

Thread ID:

Created:

Updated:

Platform:

Replies:

14375 May 25,2004 07:12 PM May 28,2004 02:20 AM Windows Forms 7
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 25, 2004 07:12 PM

this.grid.CellDoubleClick += new GridCellClickEventHandler(grid_CellDoubleClick); private void grid_CellDoubleClick(object sender, GridCellClickEventArgs e) { Console.WriteLine("Double clicked"); } this works when the cell on my grid is "Static" but doesn''t work after i populate the grid with some data and change the CellType to "TextBox" in other words, the event is not fired when i have the editing caret inside a cell why? and any way around this? thanks in advance!

Administrator [Syncfusion]
Replied On May 26, 2004 02:00 AM

Try the CurrentCellControlDoubleClick event to see if that gives you what you need.

Administrator [Syncfusion]
Replied On May 26, 2004 01:33 PM

thanks Clay but the version of syncfusion i have doesn''t have the metioned event is there any other way of doing it? >Try the CurrentCellControlDoubleClick event to see if that gives you what you need.

Administrator [Syncfusion]
Replied On May 26, 2004 03:04 PM

You could try to use the technique discussed in this forum thread. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=14267 The idea would be to listen to CurrentCellControlGotFocus and subscribe teh the double click event of teh cell control there. Then in CurrentCellControlLostFocus, unsubscribe to it.

Administrator [Syncfusion]
Replied On May 27, 2004 04:45 PM

this technique doesn''t work for double click private void gridControl1_CurrentCellControlLostFocus(object sender, System.Windows.Forms.ControlEventArgs e) { e.Control.DoubleClick -= new EventHandler(Control_DoubleClick); Console.WriteLine("xHooked"); } private void gridControl1_CurrentCellControlGotFocus(object sender, System.Windows.Forms.ControlEventArgs e) { e.Control.DoubleClick += new EventHandler(Control_DoubleClick); Console.WriteLine("Hooked"); } private void Control_DoubleClick(object sender, EventArgs e) { Console.WriteLine("double clicked!"); } the double click event is never fired >You could try to use the technique discussed in this forum thread. > >http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=14267 > >The idea would be to listen to CurrentCellControlGotFocus and subscribe teh the double click event of teh cell control there. Then in CurrentCellControlLostFocus, unsubscribe to it. > >

Administrator [Syncfusion]
Replied On May 27, 2004 05:27 PM

From you discussion above, I thought you were trying to catch a double click on a cell that already was showing the edit cursor. And I thought the code you showed above would catch this case. (It seemed to do so when I tried it). But if you want to catch a double click on a cell that is NOT showing the edit cursor, then it takes more work (unless you upgrade to the release that has the CurrentCellControlDoubleClick event). Below is a sample that seems to catch double clicks in both cases. It uses the technique described above to catch the double click on an editing cell. To catch the double click on an cell that is not editing, it handles single click events both in the grid and in the cell control, testing to see if the two events are handled within doubleclick time. If they are, then it marks it as a doubleclick. DoubleClick_5180.zip

Administrator [Syncfusion]
Replied On May 27, 2004 06:07 PM

thanks clay, but the sample code doesn''t work on my machine, i got both Syncfuion.Grid and Syncfusion.Shared dlls versioned 1.5.2.0 is that the problem? >From you discussion above, I thought you were trying to catch a double click on a cell that already was showing the edit cursor. And I thought the code you showed above would catch this case. (It seemed to do so when I tried it). > >But if you want to catch a double click on a cell that is NOT showing the edit cursor, then it takes more work (unless you upgrade to the release that has the CurrentCellControlDoubleClick event). Below is a sample that seems to catch double clicks in both cases. It uses the technique described above to catch the double click on an editing cell. To catch the double click on an cell that is not editing, it handles single click events both in the grid and in the cell control, testing to see if the two events are handled within doubleclick time. If they are, then it marks it as a doubleclick. > >DoubleClick_5180.zip > >

Administrator [Syncfusion]
Replied On May 28, 2004 02:20 AM

Yes, that does seem to be the problem. In 1.5.2.0, the cell control is eating the clicks (to position teh cursor or select all the text), and not notifying the grid of the click. Without deriving several classes in 1.5.2.0, I do not know of a way to try to work around this problem. It probably would be simpler to update to a later version. This is changed in the 1.6.1.8 and 2.0 code bases.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;